테이블합치기
-
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..