Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Is there any function corresponds to DECODE in Oracle ?
Message
De
27/10/1999 23:04:25
 
 
À
27/10/1999 10:32:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
00282059
Message ID:
00282810
Vues:
26
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform