Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Tue, 11 Jan 2005 @ 10:01:57 GMT


     
  <Prev Next>  
<<First
<Prev
Next> Last>>  


Subj:   Ranking in Queryman
 
From:   Allan Holmes

hope someone out there can help me.

I want to get the top N for a range of data where the combination could yield 80,000 rows split across 120 locations

fields are;

     Location
     Barcode
     SOH

     SQL;

     SELECT Location, Barcode, SOH FROM TableName WHERE SOH < 0

thus i would like to see a result set something like;

     LocA;BarcodeA;SOH
     LocA;BarcodeB;SOH
     LocA;BarcodeC;SOH
     LocB;BarcodeA;SOH
     LocB;BarcodeB;SOH
     LocB;BarcodeC;SOH
     LocC;BarcodeA;SOH
     etc etc etc

I am trying to use the RANKING function but can't figure how to 'reset' the rank back to 1 when a change of location occurs.

any assistance one of you could offer would be greatly appreciated.

cheers.


--------------------------
Regards,

Allan.
Information Technology - Report Support
The Warehouse Group (Australia) Pty Ltd



     
  <Prev Next>  
<<First
<Prev
Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 27 Dec 2016