Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 24 Feb 2012 @ 14:34:37 GMT


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


Subj:   Re: Retrieve next 50 rows after reference value
 
From:   td newsgroup

Hi Fred,

this might give you an idea.

if day of month = 15 get the next 7 days as well..

     select *
     from sys_calendar.calendar
     where year_of_calendar = 2012
     qualify 1 = max(case when day_of_month = 15 then 1 else 0 end)
     over (order by calendar_Date desc rows between current row and 7 following)
     order by calendar_date;

Ulrich

www.data2knowledge.de



     
  <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