Tags for same sql
Difference of rows in SELECT COUNT(*) and SELECT *
Hi, I am facing a weird problem of which can not really figure out what could be the reason of that. Consider following SELECT statement: SELECT Col1, Col2, Col3 FROM View1 QUALIFY ROW_NUMBER() OVER(PARTITION BY Col4 ORDER BY Col5) = 1 We get 644,539 rows in return. If we take a COUNT(*) as below: SELECT COUNT(*) FROM ( SELECT Col1, Col2, Col3 FROM View1 QUALIFY ROW_NUMBER() OVER(PARTITION BY Col4 ORDER BY Col5) = 1 ) A It gives us count to be 158,446 If we do SELECT * as below: SELECT * FROM ( SELECT Col1, Col2, Col3 FROM View1
rows select count mismatch same sql