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

Can more than 1 metric be applied on an analytic in business objects?

1647


WHAT ARE THE META DATA TYPES?WHICH META USING IN BO'S

1684


Explain what are the steps to be taken to schedule the report?

631


Explain difference between zabo and webi?

645


I have 2 doubts regarding the "Input Control" functionality in BI4: 1) Can the Input Controls in BI4 be manipulated? I mean, can we change the IC display as BOLD or change the values from Italics to regular? Or change the colors? 2) How to get hierarchy type control in IC? Let's say my first IC is for Country and second is for State. If I select a particulat country from Ist IC,second one should show me states belonging to selected country. Is that possible? Thanks in advance!!!

1747






Explain is data mart?

582


How were the reports scheduled and how to resolve unexecuted documents?

2201


Explain as a ba (business analyst) approaching a new piece of work, who would you interview and what questions would you ask?

547


Explain about alerts in bos, under what situation we need to use alerts?

547


how many reports have u created ? explain a few.

1655


How would you format some text using css to be verdana and bold?

660


Explain what if a cartesian product pop up block appears when running a report. Does it give wrong values? How to solve this issue?

618


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

992


Can I create a master report in webi having 15 dimensions and 150 kpi's with 100GB of data and store it in cache ,So that I can use Cache for building new reports with less dimensions and Kpi's without hitting database againg just using cache??Please suggest...

1614


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

686