Select from one table where not in another

前端 未结 4 1042
情深已故
情深已故 2020-11-29 22:05

I\'m trying to find the rows that are in one table but not another, both tables are in different databases and also have different column names on the column that I\'m using

4条回答
  •  广开言路
    2020-11-29 22:33

    You can LEFT JOIN the two tables. If there is no corresponding row in the second table, the values will be NULL.

    SELECT id FROM partmaster LEFT JOIN product_details ON (...) WHERE product_details.part_num IS NULL
    

提交回复
热议问题