两表不同数据比较SQL

select constructinfo.depid, constructinfo.depname, canton.CANT_NAME from constructinfo ,canton where canton.id=constructinfo.workplace
and  depid
not in(
select enterprise_id from EnterpriseLastScore where  enterprise_type ='sg')

and constructinfo.depname
not in
(
select 施工单位 from temp1 where   类别='施工单位')
order by constructinfo.workplace asc

你可能感兴趣的:(sql)