0 - 7 of 7 tags for qualify
/*I have two views in a company’s HR database I am pulling from. 

One gives a list of hiring actions. The first time an employee is hired, they’re given a sequence of 1. Each time after they’re given a sequence of 2, 3, 4 and so on.

The second view I’m querying has similar information for employees who were terminated. 

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

Hi,  I am trying to run the below query, in vain. I was able to get the results by using a different logic.
However I am not able to understand why my query for search didn’t work, while my query for sales worked (they are both essentially the same query with different column names)

Can someone throw some light how can QUALIFY,GROUP BY and HAVING be used together?
Any link to docs or simple example will be usefull.
Also which one takes precedence, when used together and what is the correct syntax when using all three of them?


I am a beginner concerning the Teradata. I was trying to find simple descriptions on the internet about functions QUALIFY; RANK; OVER; PARTITION BY - unfortunately unsuccessfully. I coudn't find a simple explanation what does each of the funcions do.

Can anyone send me a link or give a explanation about this functions.

I have a requirement in that i have to use two qualify in the same query based on the value returned(this value is also returned by a qualify statement).


Ex :













I am working on Teradata to Oracle migration project.

Select frm_crncycd,to_crncycd,exch_rate from exchange_rate
group by 1,2
qualify(rank(frm_dt)) =1

Can someone explain what is the behavior of above query.
So that i can rewrite the query in Oracle.