Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there any function corresponds to DECODE in Oracle ?
Message
From
27/10/1999 23:04:25
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00282059
Message ID:
00282810
Views:
27
Thanks Michael for reply.
The decode function acts like this

select emp_id,emp_name, sex from emp

emp_id emp_name sex
------ -------- ---
001 John M
002 Susie F
003 David M
004 Dummy null

Using decode

Select emp_id , emp_name , DECODE(sex,'M','Male','F','Female','Male') SEX
From emp

emp_id emp_name SEX
------ -------- ------
001 John Male
002 Susie Female
003 David Male
004 Dummy Male

Thus the format is as below

DECODE(value,if1,then1,if2,then2,.......else)

TIA
OCP8 DBA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform