巷尾的酒吧

            BlogJava :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理
            64 Posts :: 0 Stories :: 5 Comments :: 0 Trackbacks
          select t.empno,nvl(t.mgr,'MGR') from emp t where t.deptno in (select s.deptno from dept s where s.deptno='1')
          select t.empno,nvl(t.mgr,'MGR') from emp t where exists (select s.deptno from emp s where s.deptno='1' and t.deptno=s.deptno)
          select t.empno,nvl(t.mgr,'MGR') from emp t where t.deptno is not null and exists (select s.deptno from emp s where s.deptno='1' and t.deptno=s.deptno)
          select t.empno,nvl(t.mgr,'MGR') from emp t where not exists (select s.* from dept s where s.deptno  in(2,3) and t.deptno=s.deptno)
          select t.empno,nvl(t.mgr,'MGR') from emp t where t.deptno in (select s.deptno from dept s where s.deptno not in(2,3))































          posted on 2012-10-11 13:31 abing 閱讀(186) 評論(0)  編輯  收藏 所屬分類: sql

          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 沙坪坝区| 澄城县| 宁海县| 得荣县| 兴义市| 土默特右旗| 拉萨市| 定州市| 丰城市| 隆安县| 五家渠市| 巨野县| 腾冲县| 潼南县| 凌云县| 陆良县| 攀枝花市| 徐闻县| 栖霞市| 石门县| 厦门市| 庆元县| 伊通| 射洪县| 桂林市| 睢宁县| 曲松县| 乳山市| 苏尼特右旗| 文水县| 林周县| 清新县| 敦化市| 高台县| 湖北省| 白朗县| 双江| 慈利县| 云阳县| 蒲城县| 类乌齐县|