Let say I am having "Employee_Sal" table with following columns:
Employe_Sal ( wage_No, From_Date, To_Date, Amt)
No | From_Date | TO_Date | AMT
1 ____01/7/2015 ____25/7/2015___40000
2 ____26/7/2015 ____05/8/2015___38000
3 ____03/8/2015 ____12/8/2015___59000
So here, I want to list out those two record which are like 2nd and 3rd here -
Next records From_Date should be LESS THAN Current Records TO_DATE
if we compare Record 1 and 2 ---- its fine
if we compare record 2 and 3 ----- 5/8/2015 < 3/8/2015 ----- IS FALSE
--- So I want to find such records using SQL Query.
Any Suggestions or Any Help, Please help.
EDITED:
I want to compare my record with my NEXT RECORD ONLY, not with the all records in the Table.