|
|
|
Help me design this Oracle query in MySQL [message #340612 is a reply to message #340567] |
Wed, 13 August 2008 07:36 |
kathironline2003
Messages: 2 Registered: August 2008
|
Junior Member |
|
|
Given A table with 5 columns(c1,c2,c3,c4,c5) and 1...N rows.
Note that c1 is an Integer column.
I need a select query that will give me an output of
c1 of row1, ((c1 of row2 - c1 of row1)
SELECT c1,
LEAD(c1, 1, 0) OVER (ORDER BY c1) - c1 AS diff
FROM table;
In Oracle LEAD functions solve it well. But is there an equivalent function in My SQL?
|
|
|
|
|