tbl_posting_job_info
tbl_company_info
company_id companyname
---------------------------
1 XYZ
4 PQR
8 LMN
现在我想了解一家公司的信息,该公司甚至没有一个“活跃”的工作。
答案 0 :(得分:2)
select *
from tbl_company_info c
where not exists
(
select *
from tbl_posting_job_info j
where j.company_id = c.company_id
and j.status = 'active'
)
答案 1 :(得分:0)
select *
from tbl_company_info a
where Isnull((
select count(*)
from tbl_posting_job_info b
where a.company_id = b.company_id
and a.status = 'active'
),0) = 0