[DB]데이터 베이스/오라클DB(Oracle)
[DB]데이터베이스 오라클 / SQL 함수/ 집계합수/숫자함수/문자열함수/날짜 함수/형변환 함수/ having/sum/avg/group by
해병1188기
2021. 3. 24. 10:17
728x90
반응형
havig 사용하기
직급(position)별로 pay 합과 평균 구하는데 ,직급이 과장인 사람만 출력
select position , sum(pay),avg(pay)
from emp2
group by position
having position ='과장';
--
select name hpage,instr(hpage,'/',-1)
from professor;
--
select name hpage,substr(hpage,instr(hpage,'/',-1)+1)"홈피주소"
from professor
where hpage is not null;
728x90
반응형