![]() |
|
![]() |
![]() |
Archives of the TeradataForumMessage Posted: Wed, 25 May 2011 @ 10:10:25 GMT
I would start with something like: Select field1, field2, field3, start_date, Row_number() Over (Partition By field1, field2, field3) order_field From MyTable Qualify order_field = 1 Order By start_date If the end_date is always one day less than the start_date of the next "step", you can join this query with itself using Query1.order_field=Query2.order_field+1 or something like that. Carlos Carpio Garcma
| ||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ||||||||||||||||||||||||||||||||||||||||||||||||
Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||