题解 | 查询单日多次下订单的用户信息?

查询单日多次下订单的用户信息?

https://www.nowcoder.com/practice/9958aed1e74a49b795dfe2cb9d54ee12

select date(order_time)order_date,o.user_id,count(order_id)order_nums,vip
from order_tb o 
join uservip_tb u
using(user_id)
group by date(order_time),o.user_id,vip
having count(order_id) >1
order by order_nums desc;
我终于想起来用having而不是where了哈哈

全部评论

相关推荐

03-04 07:14
门头沟学院 C++
后测速成辅导一两个月...:老板:都给工作机会了还想要工资,哪来这么多好事
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务