我有一个not in
这样的子句查询:
select *
FROM COMPANY c
where c.company_id not In (SELECT SenderId
FROM CrossRef)
and c.id not in (select company_id
FROM USER)
我想知道是否有办法在 SQL Server 2008 中使用左连接重写该查询。
我尝试了以下一个,但它没有给出正确的结果
select c.id, c.company_id
from COMPANY c
left join CrossRef cr on c.company_id != cr.senderid, COMPANY c1
left join USER u on c1.id != u.company_id