Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

Need to calculate using LEAD, LAG function - topic by arbiswas

$
0
0
Dear Experts, I am stuck with the below issues. Pls help.   The below example shows the leave records for an employee id 31750. We need to calculate the leave duration. Here EMPL_STATUS='LEAVE' indicates leave and 'ACTIVE' indicates the active status of the employee. If you see the data, there are 3 leave periods showing in the below table which we need to capture by writing SQL. If you see the data from bottom to top, leave starts from 1/1/2009 (status='LEAVE') and ends on 1/23/2009 (status='ACTIVE').

read more


Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>