what is difference between decode and case function?

Answers were Sorted based on User's Feedback



what is difference between decode and case function?..

Answer / neha sinha

1)Performance wise Case is good.

2)Case is easy to understand and debug.

3)Case is ANSI stranded and Decode is property of oracle.

4) We can use Decode only in SQL but we can use Case any
where like Function/procedure.

5)Decode can be use only for continuous data not for range
value. but case can be use for range value and it allowed
operator like ">" "between" also.

Is This Answer Correct ?    17 Yes 0 No

what is difference between decode and case function?..

Answer / shiva kumar

Case functions are of two types
1. SIMPLE CASE(Equivalent to DECODE)
2. SEARCHED CASE

1.SIMPLE CASE is equivalent to DECODE in performance.The
only difference is it is ANSI Standard where as DECODE
function is designed by oracle.

2.SEARCHED CASE is more powerful then DECODE.Using SEARCHED
CASE we can evaluate multiple conditions,range evaluation.

Is This Answer Correct ?    3 Yes 0 No

Post New Answer

More SQL PLSQL Interview Questions

What is a primary key sql?

0 Answers  


what is the difference between granting and creating a view?

2 Answers  


what is subquery? : Sql dba

0 Answers  


Is sql better than access?

0 Answers  


What pl/sql package consists of?

0 Answers  






how to write date and time literals? : Sql dba

0 Answers  


What is the difference between the sql*loader and import utilities? : aql loader

0 Answers  


What is different between union and minus?

7 Answers   Accenture, TCS,


Explain select statements in sql?

0 Answers  


What is rownum and rowid?

0 Answers  


What is the difference between inner join and natural join?

0 Answers  


If 100 tables are there in user_tables.I want to find in which table zero records are there with table name.Is it possible?

2 Answers  


Categories