반응형

[Oracle SQL] SELECT 실습_ WHERE 절



I WHERE

▶ WHERE : 원하는 ROW만 조회


1. 

SELECT * FROM EMP WHERE DEPTNO = 20;




2.

SELECT EMPNO, ENAME, JOB, SAL FROM EMP WHERE SAL > 1500;




3. 

SELECT EMPNO, ENAME, JOB, SAL, DEPTNO FROM EMP WHERE DEPTNO = 20 AND SAL > 1500;




4. 

SELECT DEPTNO, ENAME, JOB FROM EMP WHERE JOB = 'SALESMAN';




5.

SELECT DEPTNO, ENAME, JOB FROM EMP WHERE 1=1;




6.

SELECT DEPTNO, ENAME, JOB FROM EMP WHERE 1=2;




I 비교연산, 사칙연산


1. 

SELECT EMPNO, ENAME, SAL, SAL*12, COMM, COMM+300 FROM EMP;




2. 연산자 우선순위 확인

SELECT EMPNO, ENAME, SAL, SAL+500*12,(SAL+500)*12 FROM EMP;









반응형