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

Z X,

 

First off this forum is for SQL Anywhere, so your question is more suitable to be asked in

 

 

http://scn.sap.com/community/hana-in-memory .

 

However, looking at our HANA SQL Help page, it seems like it does not support IF-ELSE clause, instead they use CASE expression.

https://help.sap.com/saphelp_hanaplatform/helpdata/en/20/a4389775191014b5a6bf2ccc0df2ed/content.htmHi

 

So,

 

I believe if you ran

SELECT COUNT(*) as CNT_TOT, SUM(CASE WHEN var1='""' THEN 1 ELSE 0 END) AS CNT1_MISSING

, might work, given that HANA SQL supports conditional statement inside SUM  Aggregations.


Viewing all articles
Browse latest Browse all 2182

Latest Images

Trending Articles



Latest Images