106. Examine the data in the LIST_PRICE and MIN_PRICE columns of the PRODUCTS table:
LIST_PRICE MIN_PRICE
10000 8000
20000
30000 30000
Which two expressions give the same output? (Choose two.)
A. NVL(NULLIF(list_price, min_price), 0)
B. NVL(COALESCE(list_price, min_price), 0) 如果list_price为空,则返回min_price,如果min_price为空,则返回空值,如果是空值,则返回0
C. NVL2(COALESCE(list_price, min_price), min_price, 0)
D. COALESCE(NVL2(list_price, list_price, min_price), 0) 如果list_price为空,则返回min_price,如果min_price为空,则返回0,否则返回list_price,
Answer: BD
答案解析:
LIST_PRICE 从表中看,没有空值,故
B的结果为list_price,D的结果为list_price
C的结果为min_price
A分情况,不等时为list_price,相等时为0
4.COALESCE参考:http://blog.csdn.net/rlhua/article/details/11919341