mysql: select count until?

Sunhk_25 Sunhk_25 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我想查询一个id按顺序wait_order排序后,count前面有多少个。
mysql 有until这样的语句吗?
select count(*) from reserves order wait_order until id = 3;

`reserves` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`member_id` int(11) NOT NULL DEFAULT '0',
`wait_order` smallint(4) NOT NULL DEFAULT '0'
}
id, member_id, wait_order
1, 3, 1
2, 3, 3
3, 1, 2
4, 2, 4


...全文
评论 7
收藏 已收藏
分享
返回顶部
Sunhk_25
MySQL 57,062 成员 56,759 内容