SQL how to compare two columns from two different tables

后端 未结 6 1646
无人共我
无人共我 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:48

    SELECT *  FROM table1 t1
    RIGHT JOIN table2 t2
    WHERE
    t1.c1 = t2.c6 AND
    t1.c2 = t2.c7
    

提交回复
热议问题