i need simple SQL to calculate the time diff between Two Consecutive Rows
anyone can help
Time Difference Between Two Consecutive Rows
oracle
Related Question
- How to calculate time difference in sql
- Update the other columns which are for to have minimum of other 2 columns , difference between 2 columns , and others
- Update rows in a table with an index column starting from 0 with consecutive numbers
- Select all data from two tables with partial common data
- Oracle – Filter Rows by Date Range and Hours
Best Answer
You can use a window function (aka "Analytic Function") to access values in the rows outside of the "current" row.
If you do that, it is mandatory to specify a criteria that defines the sort order of the rows otherwise there isn't such a thing as "the previous rows".
Given the extremely limited information you have shown us, you are probably looking for something like the following: