0

tbl_posting_job_info

tbl_posting_job_info

tbl_company_info

company_id     companyname
---------------------------
1              XYZ
4              PQR
8              LMN

现在我想要一个公司的信息,它甚至没有一个“活跃”的工作。

4

2 回答 2

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'
        )
于 2012-06-28T07:34:54.727 回答
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
于 2012-06-28T07:53:35.157 回答