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

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

Help regarding query

From: Atish Prasad Das <atish.das_at_wipro.com>
Date: Fri, 26 May 2000 14:36:19 +0530
Message-Id: <10509.106835@fatcity.com>


This is a multi-part message in MIME format.

------=_NextPart_000_01C0_01BFC71F.C18F97B0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 7bit

This message is scanned for Viruses

------=_NextPart_000_01C0_01BFC71F.C18F97B0 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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.

------=_NextPart_000_01C0_01BFC71F.C18F97B0 Content-Type: text/html;

        charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2014.210" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Gurus,</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Can some one tell me how to do =
this?</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Name&nbsp;&nbsp;&nbsp;&nbsp;=20
Status</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>----&nbsp;&nbsp;&nbsp;&nbsp;=20
------</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = LI</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = DE</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EX</FONT>=
</DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>B&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = DE</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>B&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = EX</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = LI</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = EX</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>In the above table, there can =
be only one=20
record per Name where the status will be LI.</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>The query result should be like =

this:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Result:</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Name&nbsp;&nbsp;&nbsp;&nbsp;=20
Status</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>----&nbsp;&nbsp;&nbsp;&nbsp;=20
------</FONT></DIV>
<DIV><FONT face=3D"Courier New"=20

size=3D2>A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;LI</FONT></DIV>=

<DIV><FONT face=3D"Courier New" =

size=3D2>B&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 ZZ</FONT></DIV>
<DIV><FONT face=3D"Courier New" =

size=3D2>C&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20 LI</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>i.e. If there is at least one =
occurence of=20
LI status, then the name should have LI as status. If there is no LI at = all,=20
then also the Name should appear, but with a Status ZZ.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Can somebody help in this =
Received on Fri May 26 2000 - 04:06:19 CDT

Original text of this message

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