由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - MySQL怎样查询各科前三名的分数?
相关主题
To get the 2nd, 3rd, 4th largest value请教关于下面这个sql code地解释
给大家贡献一个fb面试的sql问题[转载] database for Linux?
mysql doesn't support subquery still?Re: recursive sql?
纪录查找问题help about SQL for ACCESS
请教一个有关SQL concat的问题求教(SQL/Access): Join两个query tables 出错
MySQL语句请教Codes Re: 求教: Join 两个query (data)
求教mysql数据库构建how to make this query
aks a simple SQL questionWhy is EXISTS generally faster than IN clause?
相关话题的讨论汇总
话题: mysql话题: limit话题: sc话题: score话题: select
进入Database版参与讨论
1 (共1页)
d******i
发帖数: 7160
1
简单说table(SC) 就两列:科目(cid)和分数(score)
因为MySql不让top 3,只得LIMIT 3.
SELECT score FROM SC SC0
WHERE score IN (
SELECT score FROM SC
WHERE cid=SC0.cid
ORDER BY score DESC
LIMIT 3
) T2
;
结果报错:
ERROR 1235 (42000): This version of MySQL doesn't yet support 'LIMIT & IN/
ALL/ANY/SOME subquery'
咋办呢?
请指教。谢了!
1 (共1页)
进入Database版参与讨论
相关主题
Why is EXISTS generally faster than IN clause?请教一个有关SQL concat的问题
一个看似简单的sql语句MySQL语句请教
感觉SQL里的求教mysql数据库构建
Please Help! ORA-00918: column ambiguously definedaks a simple SQL question
To get the 2nd, 3rd, 4th largest value请教关于下面这个sql code地解释
给大家贡献一个fb面试的sql问题[转载] database for Linux?
mysql doesn't support subquery still?Re: recursive sql?
纪录查找问题help about SQL for ACCESS
相关话题的讨论汇总
话题: mysql话题: limit话题: sc话题: score话题: select