求助数据库问题

查询成绩最高的十个姓王的学生的姓名,语句怎么写。。。
全部评论
select name from std where name like '王%' order by score desc limit 0,10;
点赞 回复 分享
发布于 2017-09-15 13:22
先找姓王的,再排序,在用 limit 取前10个。
点赞 回复 分享
发布于 2017-09-15 13:21
select 姓名,row_number() over(partitioned by substr(姓名,1,1) order by 成绩 desc) from thl where substr(姓名,1,1) = 王 limit 10
点赞 回复 分享
发布于 2017-09-15 16:19

相关推荐

许愿ssp的咸鱼很不想泡池子:import python as pyhton
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客企业服务