OCP-1Z0-051-V9.02-106题

本文通过一个具体例子解析了SQL中的NVL、NVL2、NULLIF和COALESCE等函数的功能及使用方法,并对比了不同表达式的输出结果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
 
 
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值