Hi I have a table as below,
Id StartDt EndDt
----- -------- -------
123 01-Apr-2016 15-Apr-2016
456 02-Apr-2016 03-Apr-2016
I want to write a generic sql Insert statement that will work in all DB platforms.
So that I will insert a data similar to below into a new table from the above one
New Table value after Insert:
Id Date SeqNo
123 01-Apr-2016 1
123 02-Apr-2016 2
123 03-Apr-2016 3
123 04-Apr-2016 4
123 05-Apr-2016 5
123 06-Apr-2016 6
123 07-Apr-2016 7
123 08-Apr-2016 8
..
..
..
..
123 15-Apr-2016 15,
AssignmentID Date SeqNo
123 1-Apr 1
123 2-Apr 2
123 3-Apr 3
123 4-Apr 4
123 5-Apr 5
.
.
.
.
.
123 15-Apr 15
So fifteen rows for the first row i.e (End Date - Start Date) and similarly two rows for the second row from the main table(End Date - Start Date).