Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> SQL - Combine multiple records to give 1 record
I have a table
person_id start_month end_month 1 200301 200303 1 200302 200303 1 200303 200304 1 200306 200308
For the first 3 records, the end_month of the previous record is less than the start_month of the next record. I want to write a SQL to combine them and give me the following result
person_id start_month end_month 1 200301 200304 1 200306 200308
I can easily do it in PL/SQL but wanted to do it in SQL. Please help.
Thanks
PK
Received on Fri Aug 26 2005 - 15:43:29 CDT
![]() |
![]() |