Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Query - 2nd Request Pls Help

Query - 2nd Request Pls Help

From: salu Ullah <salu_ullah_at_hotmail.com>
Date: Mon, 19 Jun 2000 14:40:21 GMT
Message-Id: <10533.109712@fatcity.com>


Hello

I have a table with columns & data as follows

cust_id item_code purc_date status

0001      AAAA      01-JAN-00     A
0001      AAAA      02-JAN-00     A
0001      AAAA      03-JAN-00     A
0001      AAAA      04-JAN-00     B
0001      AAAA      05-JAN-00     B
0002      BBBB      05-JAN-00     A
0001      AAAA      06-JAN-00     A
0002      BBBB      06-JAN-00     A
0001      AAAA      07-JAN-00     A

. . . .
. . . .
0001 AAAA 29-JAN-00 A 0001 AAAA 30-JAN-00 B 0001 AAAA 31-JAN-00 B

I'am looking for a query that will give the folllowing result:

cust_id item_code status from_date to_date

0001      AAAA       A      01-JAN-00   03-JAN-00
0001      AAAA       B      04-JAN-00   05-JAN-00
0002      BBBB       A      05-JAN-00   06-JAN-00
0001      AAAA       A      06-JAN-00   29-JAN-00
0001      AAAA       B      30-JAN-00   31-JAN-00


I tried using min(purc_date) & max(purc_date) & grouping them with the remaining columns,
but was not getting the desired output.

Any input will be appreciated. Thanks in advance

Salu



Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com Received on Mon Jun 19 2000 - 09:40:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US