Difference between data in two lines
Posted on 2008-06-10
I have a table in a database that is built up like this :
Cost Date_val Time_val
I need to make a SQL query that returns Time_val value difference between two lines and the Date_val value of the first line. I need to do this only when the Cost value in the first line is 0 (it will never be 0 two times in a row).
How should my query look like ?