Quantcast
Channel: SCN : Discussion List - SAP HANA and In-Memory Computing
Viewing all articles
Browse latest Browse all 5653

About Count of missing vaule, Count Distinct

$
0
0

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.


Viewing all articles
Browse latest Browse all 5653

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>