标签:des style blog http ar sp on div 2014
select 基本构成之经典格式
select * from emp;
select * from emp where empno>8000;
select empno,ename,sal,comm from emp where sal<comm;
select deptno,count(*) from emp group by deptno;
select deptno,sum(sal) total_sal from emp where job=‘MANAGER‘ group by deptno;
select job,count(distinct deptno) from emp where mgr is not null group by job order by job;
select job,count(distinct deptno) from emp where mgr is not null group by job order by count(distinct deptno) desc,job;
select job, count(distinct deptno) uniq_deptno from emp where mgr is not null group by job order by uniq_deptno desc, job;
select deptno, to_char(hiredate,‘yyyy‘),count(*) from emp group by deptno,to_char(hiredate,‘yyyy‘);
标签:des style blog http ar sp on div 2014
原文地址:http://www.cnblogs.com/mahun/p/4125721.html