All Forums Database
Dantes 9 posts Joined 06/12
31 Jul 2012
Qualify Rank Over Partition By

Hi!

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.

Here is the part of the SQL I'm trying to figure out:

 

 

QUALIFY RANK() OVER

(

 PARTITION BY

  TB0912.dwh_prozess_id,

  TB0912.vs_referenz_txt_id,

  CASE WHEN TB0903.event_typ_id = 46 THEN TB0912.vs_referenz_txt_id ELSE TB0903.vs_referenz_num_id END,

  TB0912.dwh_produkt_id

 ORDER BY

  TB0903.messwert_ts DESC

) = 1

31 Jul 2012

RANK basically assigns a sequential numeric identifier to each row depending on the criteria mentioned in OVER(...) clause

OVER defines the criteria based on which the sequential numbers are assigned

PARTITION BY defines the partitioning scheme, whenever there is a change of values in the paritioning scheme the sequential identifier is reset.

QUALIFY limits the number of records

You can find much more details on this link;

http://www.teradataforum.com/teradata_pdf/b035-1101-122a_5.pdf

Dantes 9 posts Joined 06/12
01 Aug 2012

Thanks QAKiani!

This documentation is exactly what I needed. 

ashkul 2 posts Joined 05/12
06 Mar 2013

Hi Qaisar 
 
thew document http://www.teradataforum.com/teradata_pdf/b035-1101-122a_5.pdf has been removed. Any idea where I can get it from ?
 
 

dnoeth 2977 posts Joined 11/04
06 Mar 2013

You don't want this document :-)
It's a a link to an old V2R5 Teradata manual, you'll find the latest version at www.info.teradata.com:
SQL Function, Operators ...
Dieter

Dieter

You must sign in to leave a comment.