Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Distinct in Case clause - forum topic by dmenzaghi

$
0
0

Hi all,
this is my input table:
val1 val2 val3 val4
111  5      aa   13:00
111  8      bb   13:00
111  12    cc    8:00
 
This is the query i used:
..
..
case when ( distinct val4 < time '12:00:00' then 1
     else 0 end) as fascia_1,
case when ( distinct val4 >= time '12:00:00' then 1
else 0 end) as fascia_2
 
What  i need to have is a one time evaluation of the variable var4.
How can i do it?
 
Thanks in advanced
D.
 
 
 
 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



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