The below code is producing different record count when running in two different environments that are Oracle and SQL Server 2008. The table in both databases are identical.
Is there any way in SQL to check record count in each step of the code using either breakpoint like mechanism, so I could find the error?
Code:
SELECT
col1, col2, col3
CASE
WHEN col4 IS NULL THEN SUM(xamt) ELSE 0
END) AS xamt,
FROM
MYTABLE as A
LEFT JOIN
LTDTABLE as B ON A.COL1 = B.COL1
WHERE
A.RECORD_ID = 'S1'
AND B.ZSTATUS = ''
AND (A..REFERRED_BY = '')
OR (B.ZSTATUS = '')
AND A.REFERRED_BY <> 'ZED'
Thanks