巷尾的酒吧

  BlogJava :: 首页 :: 联系 :: 聚合  :: 管理
  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 阅读(175) 评论(0)  编辑  收藏 所属分类: sql

只有注册用户登录后才能发表评论。


网站导航: