Re: oracle SQL question..

From: Bippie <no.spam_at_for.me>
Date: 1998/05/28
Message-ID: <6kj5ve$9en$1_at_hdxf08.telecom.ptt.nl>#1/1


Hi,

This one should do the trick

select * from T
where PLT = 'P1'
  or (KC,MKT,QTY) NOT IN

      (select KC,MKT,QTY
       from T 
       where PLT = 'P1')

/

gosar_at_EBB.Eng.Sun.COM (Bhavesh Gosar) schrijfbewerkingen: > Hi,
>
> I have table ....
>
> KC MKT PLT QTY
> ---------- ---------- --- ----------
> 100 M1 P1 1
> 100 M1 P1 2
> 100 M1 P1 3
> 200 M2 P1 1
> 300 M3 P3 1
> 200 M2 P2 1
> 100 M1 P2 1
>
> I want to select everything which is in PLT='P1' and
> only those records from other PLT's which have different
> combination of "KC, MKT and QTY fields"....
>
> The output should look as follows...
>
> KC MKT PLT QTY
> ---------- ---------- --- ----------
> 100 M1 P1 1
> 100 M1 P1 2
> 100 M1 P1 3
> 200 M2 P1 1
> 300 M3 P3 1
>
> Is there any one-sql statement which can do this...??
>
> TIA,
> Bg
>
>
>
>
>
Received on Thu May 28 1998 - 00:00:00 CEST

Original text of this message