为了账号安全,请及时绑定邮箱和手机立即绑定

想问一下排除法怎么查询

比如查某个部门购买的哪些商品是所有部门都没有买过的,这个需要嵌套select吗?

正在回答

2 回答

select distinct(item)  from  table  where  item  not  in  (select  distinct(item)  from  table  where  bumen<>'mouge')   and  bumen='mouge'           -----------------不知道对不对......等待实践检验

0 回复 有任何疑惑可以回复我~

select from  something where name in (select name from  something group by name having COUNT(*)>1)

0 回复 有任何疑惑可以回复我~
#1

冰枫565

这个能查重复的剩下的就是没有重复的_(:3」∠)_
2018-07-24 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

想问一下排除法怎么查询

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号