Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Oracle to Sql Server

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-04-25 : 12:18:45
klr writes "what is the equivalent of the Oracle function 'DECODE' in Sql Server ?!?"

KnooKie
Aged Yak Warrior

623 Posts

Posted - 2002-04-25 : 12:52:17
what does it do in Oracle exactly ??

Paul
Go to Top of Page

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2002-04-25 : 13:18:43
you can use a case expression

decode(a,12,1,14,2,3)

could be written as

case when a = 12 then 1
when a = 14 then 2
else 3 end

Go to Top of Page
   

- Advertisement -