SQL how to compare two columns from two different tables

后端 未结 6 1644
无人共我
无人共我 2021-01-02 16:24

I have two tables, in which table 1 contains 4 columns while table 2 contains 8 columns. I have two columns in table1 that I want to compare them with two columns in table2.

6条回答
  •  Happy的楠姐
    2021-01-02 16:53

    Try a minus statement. This will give you any results from the first select statement of table1 that aren't in the second select statement on table2.

    select column1, column2 from table1
    minus
    select column6, column7 from table2
    

提交回复
热议问题