Quantcast
Channel: Teradata Forums - Database
Viewing all articles
Browse latest Browse all 14773

Propagate row data until next date is encountered - forum topic by Harry Droogendyk

$
0
0

We don't have the ability to create stored procedures here so looking for an SQL solution to the following.  Given the following data, how can I propagate the noted rows for the date values until the next row is encountered ( dumbed down data ).  Alternatively, adding an END DATE to each data row would also suffice.  TIA
 

Name        Date            Amt

George    2013-08-01    12

George    2013-08-05    15

George    2013-08-10    8

Susan    2013-07-29    22

Susan    2013-08-03    90

 

Desired Result:

George    2013-08-01    12

George    2013-08-02    12 - generated row

George    2013-08-03    12 - generated row

George    2013-08-04    12 - generated row

George    2013-08-05    15

George    2013-08-06    15 - generated row

George    2013-08-07    15 - generated row

George    2013-08-08    15 - generated row

George    2013-08-09    15 - generated row

George    2013-08-10    8

George    2013-08-11    8 - generated row

George    .... until current date    8 - generated row

Susan    2013-07-29    22

Susan    2013-07-30    22 - generated row

Susan    2013-07-31    22 - generated row

Susan    2013-08-01    22 - generated row

Susan    2013-08-02    22 - generated row

Susan    2013-08-03    90

Susan    .... until current date     90  - generated row

 

Forums: 

Viewing all articles
Browse latest Browse all 14773

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>