巷尾的酒吧

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            64 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
          NULL指的是空值,或者非法值。
          NVL (expr1, expr2)->expr1為NULL,返回expr2;不為NULL,返回expr1。注意兩者的類型要一致
          NVL2 (expr1, expr2, expr3) ->expr1不為NULL,返回expr2;為NULL,返回expr3。expr2和expr3類型不同的話,expr3會轉換為expr2的類型
          select t.empno,nvl2(t.mgr,'the value is not null','the value is null') from emp t where t.deptno in (select s.deptno from dept s where s.deptno='1')
          NULLIF (expr1, expr2) ->相等返回NULL,不等返回expr1
          select t.empno,nullif(t.mgr,'tom') from emp t where t.deptno in (select s.deptno from dept s where s.deptno='1')
          posted on 2012-10-11 13:58 abing 閱讀(232) 評論(0)  編輯  收藏 所屬分類: oracle
          主站蜘蛛池模板: 浏阳市| 克拉玛依市| 双辽市| 西乌| 本溪| 嘉鱼县| 赞皇县| 黑水县| 高阳县| 台山市| 耿马| 和龙市| 云浮市| 双流县| 蓬安县| 安塞县| 阜康市| 石景山区| 乌兰察布市| 龙海市| 陆河县| 常德市| 白银市| 石渠县| 当涂县| 博客| 老河口市| 咸丰县| 观塘区| 桦甸市| 甘洛县| 奈曼旗| 巴中市| 陕西省| 垣曲县| 调兵山市| 沂源县| 基隆市| 怀安县| 平泉县| 苍南县|