Try this:
Select (Case
When Some_ID = Y Then DoResult1
When Some_ID = A Then DoResult2
Else DoResult3
End) As WhatIWant
From Table/View
Where Clause;
-----Original Message-----
From: Sapan Patel
[mailto:oracledba-ezmlmshield-x11008910.[Email address protected]
Sent: Thursday, June 28, 2007 3:58 AM
To: LazyDBA Discussion
Subject: Condition in CASE statement
Hi Gurus,
Can any one please tell me how put the following condition in a CASE
statement.
If all "some_Id" is Y, then A,
else if any some_Id is Y, then B.
else C
where "some_Id" is a column and A, B and C are the target values that I
want to populate based on the given condition above.
Thanks & Regards,
SK
---------------------------------------------------------------------
TO REPLY TO EVERYBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To post a
dba job: http://jobs.lazydba.com To Subscribe : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
-------------------------------------------------------------------------------------
A.G. Edwards & Sons' outgoing and incoming e-mails are electronically
archived and subject to review and/or disclosure to someone other
than the recipient.
-------------------------------------------------------------------------------------
Oracle LazyDBA home page