SQL how to compare two columns from two different tables

后端 未结 6 1620
无人共我
无人共我 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条回答
  •  醉梦人生
    2021-01-02 16:40

    Except shows the difference between two tables (the Oracle guys use minus instead of except and the syntax and use is the same). It is used to compare the differences between two tables. For example, let's see the differences between the two tables

    SELECT * FROM
     table1
    EXCEPT
    SELECT * FROM
     table2
    

提交回复
热议问题