博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mysql 分组取每个组的前几名的问题
阅读量:7118 次
发布时间:2019-06-28

本文共 561 字,大约阅读时间需要 1 分钟。

select * from hotel_addition_orders a where (select count(*)            from hotel_addition_orders            where hotel_order_id = a.hotel_order_id and type > a.type)<2 order by a.hotel_order_id asc, a.type desc; #班级排名----比我分数高的人少于2,那我就排第二名 select * from hotel_addition_orders where type = 2; select * from hotel_addition_orders a where   (select count(0) from hotel_addition_orders b where b.hotel_order_id = a.hotel_order_id and type in(1,2,5)) = 3 group by hotel_order_id order by hotel_order_id desc;

 

转载于:https://www.cnblogs.com/JimmyBright/p/9282512.html

你可能感兴趣的文章
斐波那契搜索法.
查看>>
在pfSense下设置GoDaddy动态DNS API记录
查看>>
Kotlin中使用RxJAVA的map()操作符遇到的问题
查看>>
如何对待你的员工
查看>>
我的友情链接
查看>>
android之Handler详解
查看>>
小积累,大收获
查看>>
JS、CSS合并带来的效率提升
查看>>
Json 语法 格式
查看>>
面试思考,入职初期怎么做
查看>>
php---需要判断远程URL是否有效
查看>>
我的友情链接
查看>>
java中使用switch case报错case expressions must be constant expressions
查看>>
Android开发网
查看>>
关于加域后win7、win8的C:\不能够新建文件,报0X0070522错误的解决方式
查看>>
安卓反编译揭秘,伪加密APK文件如何被破坏
查看>>
Advanced Bash Sell Scripting学习笔记1
查看>>
转:10+年程序员总结的20+条经验教训
查看>>
linux基础命令学习之mv(7)
查看>>
我的友情链接
查看>>