复制代码 代码如下:
select OrgId as 公司编码,OrgName as 公司名称
from Organise
where OrgLev=2
and item_id not in
(select OrgidS from WagesPerMonthHis
where WagesYear='2010' and WagesMonth=
'01' Group by OrgidS,OrgNameS)
order by Orgid
复制代码 代码如下:
select a.OrgId as 公司编码,a.OrgName as 公司名称,a.item_id
from Organise a
left outer join (select distinct b.OrgIdS from WagesPerMonthHis b
where WagesYear='2010' and WagesMonth='01') as b
on a.item_id = b.OrgidS
where a.OrgLev = 2
and b.OrgIdS is Null
order by 公司编码
新闻热点
疑难解答