I have a task to generate two rows based on one row...
Lets say we have a table like that below :
ID STARTDATE ENDDATE FLAG_FOR_SPLIT
5 20110709 NULL 0
when a new input come like that below :
ID STARTDATE ENDDATE FLAG_FOR_SPLIP
5 20200204 20150102 1
i would like a final table like that :
ID STARTDATE ENDDATE
5 20110709 20150101
5 20150102 20200203
5 20200204
So when a new row come with FLAG_FOR_SPLIT=1 then i have to split the row into two different with the properly start and end dates..How can i implement this?
Thank you very much