慕数据9165516
2018-07-22 15:40
比如查某个部门购买的哪些商品是所有部门都没有买过的,这个需要嵌套select吗?
select distinct(item) from table where item not in (select distinct(item) from table where bumen<>'mouge') and bumen='mouge' -----------------不知道对不对......等待实践检验
select * from something where name in (select name from something group by name having COUNT(*)>1)
SQL Server基础--T-SQL语句
175762 学习 · 618 问题
相似问题