Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 24 Feb 2012 @ 13:46:42 GMT


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


Subj:   Retrieve next 50 rows after reference value
 
From:   Graham, Fred

Hi everyone,

I would appreciate any guidance on crafting this query.? One table with columns (ID, DateTimeStamp, Status, Val1, Val2 ?). I need to search for occurrences of a particular status value (in this case the value is 116).

When I find Status = 116, then I need to retrieve that row and the next 20 rows (as ordered by DateTimeStamp). One of the issues is that the database is large and the status = 116 will occur many times. I will need to pull the subsequent rows for each occurrence of status=116. Any thoughts?


Thanks,

Fred



     
  <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