Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Wed, 23 Jun 2004 @ 16:43:34 GMT


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


Subj:   Re: How to select row numbers with something like rownum
 
From:   Victor Sokovin

  It was a great solution, but incase I want to use this in my WHERE condition how do I do that.  


A derived table might help:

     select * from
     (select row_number() over (order by col1) AAA, col2
     from some_table ) DT
     where AAA < 11 ;

It might make sense to make the DT as small as possible by putting all the restrictions in its definition.


Regards,

Victor



     
  <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