Mac [MariaDB] 12.union

델버·2022년 5월 19일
0

MariaDB

목록 보기
13/17

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명

0개의 댓글