Click here to Skip to main content
15,904,497 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
Below the input table

Number RevNumber State Time Stamp
10 1 10 8:00
10 2 10 8:15
10 3 15 8:35
10 4 20 9:00
10 5 20 9:55
10 6 20 15:45
10 7 30 20:00
10 8 30 20:15
10 9 40 21:00
10 10 50 22:00

How I get the below output table.Can someone provide me the sql to get the below table.The output table is below :-

Number RevNumber State TimeStamp GAP
10 1 10 8:00 0:35
10 2 10 8:15 0
10 3 15 8:35 0:25
10 4 20 9:00 11:00
10 5 20 9:55 0
10 6 20 15:45 0
10 7 30 20:00 1:00
10 8 30 20:15 0
10 9 40 21:00 1:00
10 10 50 22:00 12:20
Posted
Comments
shivaprasadk 20-Aug-10 5:19am    
the question is not clear. Please specify the calculation formula for getting the GAP value.
mhwasim 11-May-11 9:32am    
Question is either not complete or nto cleared

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900