RE: Convert Oracle SQL statement to MS SQL

RE: Convert Oracle SQL statement to MS SQL

 

  

Decode can be mapped to a standard CASE statement as follows:

Decode( arg, val1, result1, val2, result2, ... ,valN, resultN,
defaultval);

Approximates

Case arg
when val1 return result1;
when val2 return result2;
...
when valN return resultN;
else return defaultval;
End case;



-----Original Message-----
From: John Guderian
[mailto:oracledba-ezmlmshield-x91502654.[Email address protected]
Sent: Thursday, August 31, 2006 4:41 PM
To: LazyDBA Discussion
Subject: Convert Oracle SQL statement to MS SQL

Below is an oracle statement that I need to have converted into MS SQL.
I understand that Decode is similar to CASE, but Im not that versed in
SQL to figure this out.



(Decode("V_EMP_ALL"."HOMEDEPARTMENT",NULL,'*',"V_EMP_ALL"."HOMEDEPARTMEN
T") = "T_CO_DEPT"."DEPT_C")



Any help would be appreciated.



Thanks,



JG




========================================================================
===========
CONFIDENTIALITY NOTE:
This e-mail and any attachments are confidential and may be protected by
legal privilege. If you are not the intended recipient, be aware that
any disclosure, copying, distribution, or use of this e-mail or any
attachment is prohibited. If you have received this e-mail in error,
please notify us immediately by returning it to the sender and delete
this copy from your system

Thank you for your cooperation.

P.F. Chang's China Bistro and Pei Wei Asian Diner
========================================================================
===========




---------------------------------------------------------------------
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



Oracle LazyDBA home page