Re: oracle SQL question..

From: Andrew Protasov <protasov_at_percombank.kiev.ua>
Date: 1998/05/28
Message-ID: <6kj6fv$e23_at_post.percombank.kiev.ua>#1/1


Hi Bhavesh,

Try this one:

select *
from t
where plt='P1'
union
select kc,mkt,min(plt),qty
from t
group by kc,mkt,qty
;

Andrew Protasov

Bhavesh Gosar wrote in message <6ki3m2$7sd$2_at_engnews2.Eng.Sun.COM>...
>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