union
-
2.JOIN _ inner, outer (+ on과 where의 차이)SQL/sql 문법(mysql, mariaDB) 2024. 5. 6. 15:16
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스✔ INNER JOIN일치하는 데이터만 나온다. null 값이 있다면 포함하지 않는다.있는 자료를 기준으로 진행한다.위의 사진처럼 교집합의 값을 가져온다.⌨ 형식SELECT [COLUMN 목록] FROM [테이블1] INNER JOIN [테이블2] ON [조인 조건]WHERE [검색 조건]💻 코드로 보기# oracle 방식SELECT jikwon_no, jikwon_name, buser_name FROM jikwon,buserWHERE buser_num =buser_no;SELECT jikwon.jikwon_no, jikwon.jikwon_name, buser.buser_na..
-
UNION 코드로 알아보기SQL/sql 문법(mysql, mariaDB) 2024. 5. 2. 16:12
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스구조가 일치하는 두 개 이상의 테이블 자료 합쳐볼 수 있다.원래 테이블은 그대로 유지된다. ✔ UNION 💻 코드로 보기#sangpum1CREATE TABLE sangpum1(bun INT, pummok varchar(20) NOT NULL);INSERT INTO sangpum1 VALUES(1,'사과');INSERT INTO sangpum1 VALUES(2,'오랜지');INSERT INTO sangpum1 VALUES(3,'바나나');SELECT * FROM sangpum1;#sangpum2CREATE TABLE sangpum2(num INT, sangirum varchar(20..