2012年7月24日
摘要: select * from emp where deptno=(select deptno from emp where ename='SMITH') and ename'SMITH';select * from emp where job in(select distinct job from emp where deptno=10);select * from emp where sal>all(select sal from emp where deptno=30);select * from emp where sal=some(select sa 阅读全文
posted @ 2012-07-24 22:59 Chenyong Liu 阅读(153) 评论(0) 推荐(0)
摘要: select ename from emp where ename like '_C%';select * from emp where sal in(800,1600,950);select * from emp where mgr is null;select * from emp where sal between 2000 and 3000;select * from emp where (sal>500 or job='manager') and (ename like 'J%');select avg(sal),max(sal) 阅读全文
posted @ 2012-07-24 19:30 Chenyong Liu 阅读(152) 评论(0) 推荐(0)
摘要: rename tablename to newname;/***修改表名***/select ename,(sal+nvl(comm,0)) 年薪 from emp;/***nvl(),comm若为null,返回0***/select ename || '的月薪是' ||(sal+nvl(comm,0)) 月薪 from emp;savepoint aa;/***设置保存点***/...rollback to aa;/***回退到保存点***/ 阅读全文
posted @ 2012-07-24 17:31 Chenyong Liu 阅读(140) 评论(0) 推荐(0)