[每日一题] OCP1z0-047 :2013-08-29 NULL............................................................168
转载请注明出处:http://blog.csdn.net/guoyjoe/article/details/10558305
![[每天一题] OCP1z0-047 :2013-08-29 NULL.168](http://img.reader8.net/uploadfile/jiaocheng/20140147/2835/2014012801352836767.jpg)
正确答案:B
用函数可以针对各种数据类型时行操作,包括NULL值在内。其中有一类通用函数,是专门针对NULL值的。
1、针对NULL值的通用函数
(1)NVL(表达式1,表达式2): 转换空值为一个实际值。如果表达式1值为空,NVL将返回表达式2的值作为结果。如果表达式1
不为空,以表达式1的值作为结果。
这个函数在有些时候非常有用,在很多应用程序中,都要把空当作0处理,这利用NVL是容易实现的:
gyj@OCM> select id,name,COALESCE(salary,0) from t1; ID NAME COALESCE(SALARY,0)---------- ---------- ------------------ 2 gyj2 8000 3 gyj3 10000 4 gyj4 15000 5 gyj5 0 7 gyj7 12000
QQ:252803295
学习交流QQ群:
DSI&Core Search Ⅰ 群:127149411(技术:已满)
DSI&Core Search Ⅱ 群:177089463(技术:未满)
DSI&Core Search Ⅲ 群:284596437(技术:未满)
DSI&Core Search Ⅳ 群:192136702(技术:未满)
DSI&Core Search Ⅴ 群:285030382(闲聊:未满)
MAIL:oracledba_cn@hotmail.com
BLOG: http://blog.csdn.net/guoyjoe
WEIBO:http://weibo.com/guoyJoe0218
ITPUB: http://www.itpub.net/space-uid-28460966.html
OCM: http://education.oracle.com/education/otn/YGuo.HTM