All Forums Database
Arhimag 1 post Joined 02/16
29 Feb 2016
Using fields form SELECT block in QUALIFY block

Teradata allows to use fields from SELECT block in other blocks. 
A have two tables T1 and T2. And there is a field "a" in table T1 and in T2. And i made a new field in select block^
case when T1.a > T2.a then T1.a else T2.a end AS a
and I want to use this "a" in qualify block. I don't want to write this case again. How can I do it? Are there any special alias for fields from SELECT block?

Thank you!

You must sign in to leave a comment.