(一个表)获取没有联合的行

(一个表)获取没有联合的行,第1张

(一个表)获取没有联合的行

这是你想要的吗?

select e.*from egr ewhere not exists (select 1       from egr e2       where e2.groupid = e.groupid and e2.offid <> e.offid       );

或者,如果您只想限制这两个优惠

select e.*from egr ewhere e.offid in (1, 2) and      not exists (select 1       from egr e2       where e2.groupid = e.groupid and   e2.offid in (1, 2) and  e2.offid <> e.offid       );


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5618303.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-15
下一篇2022-12-15

发表评论

登录后才能评论

评论列表(0条)

    保存