Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: Help regarding query
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
![]() |
![]() |