what is difference between decode and case function?
Answers were Sorted based on User's Feedback
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 |
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 |
What does pl sql developer do?
What is dense_rank in sql?
What is memory optimized table?
if a table is getting updated what happens if a function is called from sql query?
What does select count (*) mean in sql?
How delete a row in sql?
Will truncate release space?
how to use like conditions? : Sql dba
What are the different types of constraints?
What is a variable in sql?
what is difference b/w pravite procedures and public procedures?
3 Answers Steria, Wipro, Zensar,
What is union and union all keyword in sql and what are their differences?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)