Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Thu, 02 Dec 2004 @ 22:48:06 GMT


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


Subj:   Re: Best way of writing SQL to retrieve a sample
 
From:   Prabhjot Sodhi

Hi:

Not sure if you are after the same info, but try this:

     SELECT        country, state, RANK(county)
     FROM        (
     SELECT        country, state, county
     FROM        region
     ) as a1
     order by 1,2,3
     QUALIFY        RANK(county) <=50;

Thanks & Regards,

Pete



     
  <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: 15 Jun 2023