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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Help regarding query

RE: Help regarding query

From: Weerd de E.C. Kirsten <Kirsten.deWeerd_at_Oranjewoud.nl>
Date: Fri, 26 May 2000 11:37:44 +0100
Message-Id: <10509.106839@fatcity.com>


Select a.name, nvl(b.status,'ZZ')
from table a,
(Select name, status from table where status = 'LI' group by name, status) b where a.name = b.name(+)

Haven't tried it...

> -----Original Message-----
> From: Atish Prasad Das [SMTP:atish.das_at_wipro.com]
> Sent: Friday, May 26, 2000 11:14 AM
> To: Multiple recipients of list ORACLE-L
> Subject: Help regarding query
>
> Hi Gurus,
>
> Can some one tell me how to do this?
>
> Name Status
> ---- ------
> A LI
> A DE
> A EX
> B DE
> B EX
> C LI
> C EX
>
> In the above table, there can be only one record per Name where the status
> will be LI.
> The query result should be like this:
>
> Result:
>
> Name Status
> ---- ------
> A LI
> B ZZ
> C LI
>
> i.e. If there is at least one occurence of LI status, then the name should
> have LI as status. If there is no LI at all, then also the Name should
> appear, but with a Status ZZ.
>
> Can somebody help in this regard soon? Thanks a lot.......... Atish.
Received on Fri May 26 2000 - 05:37:44 CDT

Original text of this message

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