34,590
社区成员
发帖
与我相关
我的任务
分享
[code=sql]
--还是??
select * from 供应商表 as a where not exists(select 1 from 供应商发票表 where pkno=a.pkno ) and datediff(yy,a.时间字段,getdate())<=1
[/code]select * from 供应商表 as a where not exists(select 1 from 供应商发票表 where pkno=a.pkno and datediff(yy,a.时间字段,getdate())<=1)
select * from 供应商表 where 供应商表.id not in (select 供应商发票表. 供应商表id from 供应商发票表)