Path: dp-news.maxwell.syr.edu!spool.maxwell.syr.edu!drn.maxwell.syr.edu!news.maxwell.syr.edu!tiscali!newsfeed1.ip.tiscali.net!newsfeed.tiscali.ch!nntp.init7.net!not-for-mail
From: Rene Nyffenegger <rene.nyffenegger@gmx.ch>
Newsgroups: comp.databases.oracle.server
Subject: Re: SQL - Combine multiple records to give 1 record
Date: Fri, 26 Aug 2005 21:53:08 +0000 (UTC)
Organization: ADP Analyse, Design & Programmierung GmbH
Lines: 29
Message-ID: <deo304$8ss$1@klatschtante.init7.net>
References: <1125089008.993965.319500@g47g2000cwa.googlegroups.com>
NNTP-Posting-Host: adsl-133-50.dsl.init7.net
X-Trace: klatschtante.init7.net 1125093188 9116 213.144.133.50 (26 Aug 2005 21:53:08 GMT)
X-Complaints-To: abuse@init7.net
NNTP-Posting-Date: Fri, 26 Aug 2005 21:53:08 +0000 (UTC)
User-Agent: slrn/0.9.8.1 (CYGWIN_NT-5.1)
Xref: dp-news.maxwell.syr.edu comp.databases.oracle.server:250240

On 2005-08-26, premgoel@gmail.com <premgoel@gmail.com> wrote:
>
>
> 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


What makes the first 3 records be the first three records?




-- 
  Rene Nyffenegger
  http://www.adp-gmbh.ch/
