本文主要是介绍查询二名和第三名sql,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
top是sql server的用法
SELECT t3.*
FROM
(SELECT top 2 t2.* FROM (SELECT top 3 NAME,SUBJECT,score,stuid FROM stuscore WHERE SUBJECT = '数学'ORDER BY score DESC) t2 ORDER BY t2.score
) t3
ORDER BY t3.score DESC
mysql 的用法
SELECT *
FROMstuscore
WHERE SUBJECT = '数学'
ORDER BY score DESC
LIMIT 1, 2;
这篇关于查询二名和第三名sql的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!