How to return rows from left table not found in right table?

前端 未结 7 983
滥情空心
滥情空心 2020-12-23 09:09

I have two tables with similar column names and I need to return records from the left table which are not found in the right table? I have a primary key(column) which will

7条回答
  •  佛祖请我去吃肉
    2020-12-23 09:44

    Try This

    SELECT f.*
    FROM first_table f LEFT JOIN second_table s ON f.key=s.key
    WHERE s.key is NULL
    

    For more please read this article : Joins in Sql Server

提交回复
热议问题