Here is a sample data from table :
ID NAME Start
1 SARA 01-JAN-2006
2 SARA 03-FEB-2006
3 LAMBDA 21-MAR-2006
4 SARA 13-APR-2006
5 LAMBDA 01-JAN-2007
6 LAMBDA 01-SEP-2007
I would like to get this :
Name Start Stop
SARA 01-JAN-2006 20-MAR-2006
LAMBDA 21-MAR-2006 12-APR-2006
SARA 13-APR-2006 31-DEC-2006
LAMBDA 01-JAN-2007 <null>
I Have tried using partition and lead function but partition over name is combining all Sara rows and Lambda rows into one group/partition which is not I am trying to get.
Is there any analytic function or other way of doing this to combine the date ranges only when same person is appearing conescutively?
Thanks.