
์ฌ๋ฌ๊ฐ์ SQL๋ฌธ์ ํฉ์ณ์ ํ๋์ SQL์ ๋ฌธ์ผ๋ก ๋ง๋ค์ด์ฃผ๋ ๋ฐฉ๋ฒ
๐ซ ์นผ๋ผ์ ๊ฐ์๊ฐ ๊ฐ์์ผํจ
UNION : ์ค๋ณต๋ ๊ฐ ์ ๊ฑฐ ํ ์ถ๋ ฅ
UNION ALL : ์ค๋ณต๋ ๊ฐ๋ ๋ชจ๋ ์ถ๋ ฅ
UNION ๋ฌธ๋ฒ
select column1, column2, ... from tableA
UNION | UNION ALL
select column1, column2, ... from tableB
select * from ๋๋ฉด๋ญํ๋ where job_title like '%๊ฐ์%'
union
select * from ๋๋ฉด๋ญํ๋ where job_title like '%๋ฐฐ์ฐ%';
select * from ๋๋ฉด๋ญํ๋ where name like '์ด%'
union all
select * from ๋๋ฉด๋ญํ๋ where birthday between '1980-01-01' and '1989-12-31';
์ค์ตํ์ธ
![]() | ![]() |
|---|