union
- table과 table의 date를 합친다. join이 칼럼을 연결했다면, union은 data를 연결
select column명, column명 from table명
union
select column명, column명 from table명
union
select column명, column명 from table명
- 만약 column이 같지 않아도 type만 맞으면 date가 합쳐짐
union all
- column끼리 붙을 때 중복되는 data가 있으면 한 가지만 나온다. 이를 모두 보기 위해서 union all를 쓴다.
select column명, column명 from table명
union all
select column명, column명 from table명
union all
select column명, column명 from table명
'DB > MariaDB' 카테고리의 다른 글
[MariaDB] 14.primary key (0) | 2022.12.20 |
---|---|
[MariaDB] 13.auto_increment (0) | 2022.12.20 |
[MariaDB] 11. join (0) | 2022.12.20 |
[MariaDB] 10.논리 함수 (0) | 2022.12.20 |
[MariaDB] 9. 수학 함수 (0) | 2022.12.20 |
댓글