Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Help with Analytic Function

JambalahotJul 20 2012 — edited Jul 22 2012
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.
This post has been answered by Boneist on Jul 20 2012
Jump to Answer

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 19 2012
Added on Jul 20 2012
6 comments
628 views