728x90
반응형
select *from emp where rownum <=5;
select * from emp order by sal desc;
select *from emp where job='MANAGER' and comm is not null and comm!='';
select ename,to_char(hiredate,'YYYY') from emp;
select ename from emp where substr(hiredate,0,2)=80;
select count(*) 인원수,deptno 부서번호 from emp group by deptno;
select ename from (select rownum rm,ename from emp order by sal desc) where rownum<=5;
select * from( select rownum,rm,ename,sal from (select ename,sal from emp order by sal desc)) where rm between 5 and 10;
select ename from emp where ename like 'S#_%' escape #;
select round(avg(sal),0),deptno from emp group by deptno;
select (select dname from dept where deptno=e.deptno) || '의 급여평균은'||round(avg(sal),2)||'입니다' as 부서평균 from emp e group by deptno;
728x90
반응형
'개발 > sql' 카테고리의 다른 글
oracle sql 커서(암시적 커서,명시적 커서) (0) | 2015.09.24 |
---|---|
oracle sql (0) | 2015.09.24 |
mysql,if,ifnull, format, update,이중 select (0) | 2015.08.17 |
mysql as,update,desc,asc,is null,or,concat,like,이중 select (0) | 2015.08.14 |
tinyint ,unsigned (0) | 2015.08.13 |
댓글