问题描述
- 求一条sql语句,单表查询的
-
表结构 (姓名,课程,成绩) 现在求获的该表总成绩最高学员的名字
解决方案
mysql 数据库select sum(成绩) as t from table group by 姓名 order by t limit 0,1
oracle数据库 select * from (select sum(成绩) as t from table group by 姓名 order by t) WHERE ROWNUM<=1
sqlserver数据库 select top 1 sum(成绩) as t from table group by 姓名 order by t
解决方案二:
select top 1 sum(成绩) as t from table group by 姓名 order by t
解决方案三:
sql语句查询获取下一条数据。
【多表查询】一条sql语句
SQL语句1——单表查询
解决方案四:
select sum(score) as s from table group by name order by s limit 1
解决方案五:
select top 1 Name from TableName order by Grade desc;
或者
select Name from TableName order by Grade limit 1;
解决方案六:
select top 1 Name from TableName order by Grade desc
解决方案七:
select top 1 sum(成绩) as t from table group by 姓名 order by t
解决方案八:
select sum(score) score1 from 表名 group by 名字 order by score1 desc limit 1;
解决方案九:
谢谢你们 ,你们太好鸟
解决方案十:
select top 1 sum(成绩) as t from table group by 姓名 order by t