Posts Tagged ‘case’

CASE gotcha in Oracle 8i

“CASE works with all modern versions…”, that’s what Doug Burns wrote in his excellent article about CASE expressions. I believe that a clarification is needed here, especially for those of you who still deal with Oracle 8i. In Oracle 8i CASE statements and expressions are supported only in SQL and not in PL/SQL. In 8i […]

CASE used in CREATE INDEX

The following is a neat way to index id1,id2 when id is not null, and index NULL,NULL (which won’t be indexed) when it is:

“Between” CASE and DECODE

Here is a select statement that demonstrates the following:

Use of CASE to do a “between” logic. Use of DECODE with SIGN to do a “between” logic. How easy and clear to use CASE as compared to using DECODE.