Viewing 5 posts - 1 through 5 (of 5 total)
ok...just to be sure ....you definitely dont want to return rows for the following ?
,(9, 'D', '2003-07-08', '2006-02-06')
,(9, 'D', '2006-02-07', '2011-02-01')
,(9, 'D', '2011-02-02', '2014-01-03')
Nope, definitly not as the Product...
January 11, 2016 at 9:09 am
Sorry guys, I'm complete newbie on this forum!
In the beginning I just wondered how do I define DATEDIFF =1 between two data rows for the same Product and ID. But...
January 11, 2016 at 8:41 am
It would work but only for those Products which are not current and have END_DATE is not null. For current Product where END_DATE is null:
9, D, 2004-08-10, 2011-02-01
9, D, 2011-02-02,...
January 11, 2016 at 5:42 am
Hi! Sorry for delayed answer, was OOO during weekend.
Thank you for your efforts, I think you are close to the solution but something is still wrong with the output...
I...
January 11, 2016 at 3:23 am
;with cte as
(
Select id, product, start_date, end_date,
Row_Number() over(Partition by id, product order by (Select null)) RowNum
...
January 8, 2016 at 5:07 am
Viewing 5 posts - 1 through 5 (of 5 total)