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

Re: Determine if valid date via SQL

$
0
0

'A' is just an alias for the COUNT of the inner select (I didn't want to have to write COUNT(*) two times again). Basically, the inner select checks whether the desired date exists in the M_TIME_DIMENSION table. If it doesn't, COUNT = 0 (i.e. A = 0) and then IS_DATE (an alias for the CASE statement) is false. If it exists, then COUNT = 1, and IS_DATE is true.

 

It's probably slower however that select runs really fast (6ms in my case) so I'm not sure it'll have any considerable impact in your case. Unless of course you do that in a loop, in which case it'd be more interesting to do a join of your input table and the M_TIME_DIMENSION table and see which records exist in both.

 

Best regards,

Henrique.


Viewing all articles
Browse latest Browse all 8968

Trending Articles



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