Possible Duplicate:
SQL SERVER SELECTING ROW
If I have this table below
id time
start 08.00 AM
stop 09.00 AM
stop 09.30 AM
start 09.30 AM
start 11.00 AM
start 11.30 AM
stop 11.30 AM
stop 12.00 PM
I want output that looks like output below:
Any solution?
This is how the output I want:
id time end_time interval
start 08.00 AM 09.00 AM 60 minute
stop 09.00 AM 09.30 AM 30 minute
start 09.30 AM 11.30 AM 120 minute
stop 11.30 AM 12.00 PM 30 minute
stop 12.00 PM NULL NULL