Hi,
Can anybody tell me why this happens for these pass through SQL?
SUM(CASE WHEN var1 IS NULL THEN 1 ELSE 0) as cnt_missing FROM table
generates a value of 2, which is false.
COUNT(*) AS cnt_missing FROM table WHEN var1 IS NULL
generates a value of millions, which is true.
COUNT(DISTINCT var2) AS cnt_unique FROM table
generates a value of 2, which is false
COUNT(*) AS cnt_unique FROM (SELECT DISTINCT var2 FROM table)
generates a value about 3,000, which is true.
Thanks.