RE: Decode Statement

RE: Decode Statement

 

  


NEW_USER_2 = IF NVL(C.USER_2,'NULL') != 'YES' THEN 'NO'
ELSE TEST IF NVL(P.USER_2,'NULL') = 'YES' THEN
'YES' ELSE 'NO'

-----Original Message-----
From: Brunson Mike
[mailto:oracledba-ezmlmshield-x26716343.[Email address protected]
Sent: den 2 juli 2006 16:16
To: LazyDBA Discussion
Subject: Decode Statement


The following sql (not written by me) does what I want but I'd really
like to understand the logic. Could somebody please explain? I'm
confused by all of the parameters.

<<<<<<<<<

SELECT
DECODE(NVL(C.USER_2,'NULL'),'YES',DECODE(NVL(P.USER_2,'NULL'),'YES','YES
','NO'),'NO') INTO NEW_USER_2

<<<<<<<<<

Thanks



Mike Brunson

Information Systems Manager

Delavan Spray Technologies

Goodrich Corporation

www.goodrich.com

www.delavan.com

Phone 803-245-4347 Ext 6563

e-mail mike.[Email address protected]



This email message and any attachments are for the sole use of the
intended recipients. This message may contain proprietary and/or
confidential information which may be privileged or otherwise protected
from disclosure. Any unauthorized review, use, disclosure, reproduction,
or distribution of the message and its contents is prohibited. If you
are not the intended recipients, please contact the sender by reply
email and destroy the original message, attachments, and any copies of
the message.





--------
website: http://www.LazyDBA.com
Please don't reply to RTFM questions
Oracle documentation is here: http://tahiti.oracle.com
To unsubscribe: see http://www.lazydba.com/unsubscribe.html
To subscribe: see http://www.lazydba.com
By using this list you agree to these
terms:http://www.lazydba.com/legal.html


Oracle LazyDBA home page