Please look the following query:
SELECT ID, START, END FROM TABLEA
the result is:
ID START END
1 2012-06-07 19:32:00 2012-06-08 06:00:00
2 2012-06-08 06:00:00 NULL
But I want really a result like this:
START END
2012-06-07 19:32:00 2012-06-07 23:59:59
2012-06-08 00:00:00 NULL
The id no matters.
And look at this example:
ID START END
1 2012-06-06 19:32:00 2012-06-08 06:00:00
2 2012-06-08 06:00:00 NULL
It Must be:
START END
2012-06-06 19:32:00 2012-06-06 23:59:59
2012-06-07 00:00:00 2012-06-07 23:59:59
2012-06-08 00:00:00 NULL
The idea is to generate rows with the start and end values within the same day.
Thanks in advance.
1 Answer