What is the standard SQL Query to retrieve the intersection of tables?

前端 未结 9 598
谎友^
谎友^ 2021-02-02 03:57

Selecting the union:

select * from table1 
union 
select * from table1_backup 

What is the query to select the intersection?

9条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 04:48

    select distinct * from (select * from table1 union select * from table1_backup) 
    

提交回复
热议问题