面试啦 - 提供专业面试问题及答案、面试技巧、助您成功面试!
您的当前位置:首页 > 面试题库 > IT面试题 > Database面试题 > 正文

金蝶的一道SQL笔试题

表结构如下
————————————
Buyer Name Quantity
A 甲 2
B 乙 4
C 丙 1
A 丁 2
B 丙 5
请给出所有购入商品为两种或两种以上的购物人记录
select Buyer as 顾客,count(name) as 商品种类数 from table group by Buyer having count(name)>=2
select * from table where Buyer in (select Buyer from table group by Buyer having count(name)>=2)
词条:database面试题 数据库面试题
上一篇:一套SQL笔试题 下一篇:SQL里面如何插入自动增长序列号字段
与该文相关的文章

温馨提示:如果您对面试网有任何建议,请通过网站联系邮箱向我们反馈,感谢各位的建议与支持!