22,298
社区成员
发帖
与我相关
我的任务
分享
select * from tb t where
exists (select 1 from tb where 往来单位=t.往来单位 and 物料=t.物料 group by 往来单位,物料 having count(1)>1)
select * from tb t where
exists (select 1 from tb where 往来单位=t.往来单位 and 物料=t.物料 having count(1)>1)
select 往来单位,物料,单价
from tb t
where exists (select 1 from tb where 往来单位=t.往来单位 and 物料=t.物料 and 单价<>t.单价)
union all
select 往来单位,物料,单价
from tb
group by 往来单位,物料,单价
having count(*) > 1
select *
from tb t
where exists (select 1 from tb where 往来单位=t.往来单位 and 物料=t.物料 and 单价<>t.单价)