Quantcast
Channel: SCN: Message List - SAP SQL Anywhere
Viewing all articles
Browse latest Browse all 2182

Re: Count total and missing in one query

$
0
0

Hello Z X,

 

I haven't tried all the possibilities, but if SUM(VAR1=""), SUM(VAR2="")  are trying to find rows that have column VAR1 empty string and column VAR2 empty string, following SQL query seems to work :

 

SELECT COUNT(*) as CNT_TOT, (SELECT count(VAR1) from table_name where VAR1 = '""') as CNT1_MISSING, (SELECT count(VAR2) from table_name where VAR2='""') as CNT2_MISSING .

 

Let me know if this is your intention.


Viewing all articles
Browse latest Browse all 2182

Trending Articles



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