Sql server 如何不选择其他表中不存在的行

Sql server 如何不选择其他表中不存在的行,sql-server,tsql,notin,Sql Server,Tsql,Notin,我不想选择其他表中不存在记录的行 我希望不要选择位置表中不存在但在循环计数请求中存在的3行 代码如下 使用不存在 select * from CYCLE_COUNT_REQUEST where not exists (select 1 from LOCATION ) 或不在中: select * from CYCLE_COUNT_REQUEST where NOT IN(select 1 f

我不想选择其他表中不存在记录的行

我希望不要选择位置表中不存在但在循环计数请求中存在的3行

代码如下


使用
不存在

select *
from CYCLE_COUNT_REQUEST
where not exists (select 1 
                  from LOCATION  )
不在
中:

 select *
    from CYCLE_COUNT_REQUEST
    where NOT IN(select 1 
                      from LOCATION  )

你能告诉我们你试过什么吗?嗨,用我使用的代码更新了我的问题请粘贴代码,不要发布截图!我似乎不能发布代码,网站显示错误,所以我发布了截图