[SQL Developer] SELECT 2
정렬 SELECT first_name, salary FROM employees ORDER BY salary ASC; SELECT first_name, salary FROM employees ORDER BY salary DESC; -- 입사순으로 정렬, 급여 역순 SELECT hire_date, salary, job_id FROM employees ORDER BY hire_date ASC, salary DESC; SELECT a, b, c AS d SELECT employee_id, first_name, salary * 12 AS annsal FROM employees -- ORDER BY salary * 12 DESC; ORDER BY annsal DESC; : salary * 12를 annsal로 명칭..
2022. 5. 23.
[SQL Developer] SELECT 1
* SELECT 항목 FROM TABLE명 WHERE 조건 (조건절 연산자 : AND, OR, NULL, IS NULL, IS NOT NULL, =, !=, >, >=, 'Shanta'; -- 매니저(상사)가 없는 사원 SELECT first_name FROM employees Where manager_id is null; -- 2007년 12월 31일 이후에 입사한 사원을 출력 SELECT first_name, hire_date FROM employees Where hire_date > '07/12/31'; SELECT first_name, hire_date FROM employees --Where hire_date > '20071231'; Where hire_date > To_DATE('2007123..
2022. 5. 23.
[SQL Developer]
QUERY안의 QUERY SELECT 단일 ROW 단일 COLUMN(산출되는 데이터는 한개, 컬럼도 한개) FROM 다중 ROW 다중 COLUMN WHERE 다중 ROW 다중 COLUMN CREATE TABLE MEMBER( ID VARCHAR2(50) PRIMARY KEY, PWD VARCHAR2(50) NOT NULL, NAME VARCHAR2(50) NOT NULL, EMAIL VARCHAR2(50) UNIQUE, AUTH NUMBER(1) /* AUTH - 사용자 관리자 계정 구별?*/ ); INSERT INTO MEMBER(ID, PWD, NAME, EMAIL, AUTH) VALUES('aaa', '111', '홍길동', 'AAA', 3); INSERT INTO MEMBER(ID, PWD, NA..
2022. 5. 4.