DATABASE FUNDAMENTALS
DATA WAREHOUSING AND DATA MINING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
DECODE (search, expression, result [, search, result] ____ [, default])
|
|
DECODE (expression, result [, search, result] ____ [, default], search)
|
|
DECODE (search, result [, search, result] ____ [, default], expression)
|
|
DECODE (expression, search, result [, search, result] ____ [, default])
|
Detailed explanation-1: -DECODE compares the expression to each search value one by one. If expression is equal to a search, then the corresponding result is returned by the Oracle Database. If a match is not found, then default is returned. If default is omitted, then Oracle returns null.
Detailed explanation-2: -The DECODE function compares each expression2 to expression1. If expression1 is equal to expression2, or both expression1 and expression2 are null, the value of the result-expression is returned. If no expression2 matches expression1, the value of else-expression is returned. Otherwise a null value is returned.
Detailed explanation-3: -The DECODE function does equality comparisons between arguments, also treating null values as equal, to determine which argument to return as the result. The schema is SYSIBM. The DECODE function compares each expression2 to expression1 .