Get started Bring yourself up to speed with our introductory content.

The Oracle Guru Answer #13

Did you guess correctly? Check your answer to this week's quiz.

Were you correct? This week's answer is:
b. Searched CASE

Searched CASE statement, introduced in version 8.1, allowed the use of operators like > and BETWEEN (eliminating most contortions) and allowed different values to be compared in different branches of the statement (eliminating most nesting), according to PL/SQL expert Frank Kulash.

Before version 8.1, the DECODE was the only thing providing IF-THEN-ELSE functionality in Oracle SQL. Because DECODE can only compare discrete values (not ranges), continuous data had to be contorted into discreet values using functions like FLOOR and SIGN.

Furthermore, in version 9.0, Oracle introduced the simple CASE statement, which reduces some of the verbosity of the CASE statement, but also reduces its power compared to DECODE.

Click for more on DECODE vs. CASE.

For More Information

Expert response: PL/SQL and CASE

Expert response: Using CASE to obtain conditional SUMs

Best Web Links: SQL

Best Web Links: PL/SQL

Ask the Experts: Ask Frank Kulash for help working with SQL and PL/SQL statements.

Do you have an idea for a quiz question topic? Let us know!

Dig Deeper on Oracle DBA jobs, training and certification

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.