Difference between Decode and Case?

Answer Posted / judith

Decode
The default operator for comparison is '=',
for e.g select deptno,decode
(deptno,10,'dept10',20,dept20,default)

so if the deptno=10 then the value is replaced by dept10
and so on,

whereas in Case:

we can use any operator other than '=',
for e.g
select deptno,
case when deptno=10 and sal>1000 then 'dept10'
else
'dept20'

Hope the difference is made clear.

Regards,
Judith

Is This Answer Correct ?    33 Yes 8 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is package in BO

2690


webI report not showing Barcode in PDF format, i have used BC39 font,but barcode is shown in HTML but not in PDF, please any solutions??

3930


What is the difference between the public object&schema object?

582


Hi I'm using data federator.I would like to know if it allows select statment in where clause.For example: SELECT Employee, company, orgunit FROM TAB_BIG WHERE employee IN (Select TAB_SMALL.employee FROM TAB_SMALL WHERE flag = X ) bye

1436


(1) Is it possible to create measures using objects from different context. (2) If cross context measures are not possible then what about @aggregate_aware() function ,here we use objects from different contexts. (3)Two measures from two different context ,can they be summed at report level.

1003






any difficulitis have you phase while creating bo reports and how did u solve it

2999


Explain what three things do you consider to be the most important factors for a manager?

559


Explain are data mart and data warehouse normalized or denormalized? Do both of them exist in?

609


What is the difference between absolute and relative div positioning?

588


8. How much supervision have you typically received in your previous job?

1841


When to use local filter and when to use global filter?

603


U r project in which stage in implementation?

1951


Explain what is the difference between business requirement document and use case document.

583


What's the Functional & Architectural Differences between Business Objects & Web Intelligence Reports?

1626


How much data hold in one universe 336 can any one explain about core dimension, balanced dimension, and dirty dimension?

701