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

前端 未结 9 694
谎友^
谎友^ 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:51

    inner join i think: suppose T1 and T2 have the same structure:

    select T1.* from T1 inner join T2 on T1.pkField = T2.pkField

提交回复
热议问题