成績最高sql查詢
Ⅰ sql查詢成績表裡成績最高的同學的學號
select
學號
from
sc
where
成績in(selectmax(成績)fromsc)
Ⅱ SQL查詢平均成績最高
select * from
(
select avg(chengji) from student
group by chengji
)
where rownum <= 1;
Ⅲ SQL查詢單科成績最高的同學
SELECT child.abc,child.cource,a.name
FROM (select max(b.point) as abc,c.cource from `student` as a join `achievement` as b join `course` as c on a.sex = 1 and b.sid=a.id and b.cid=c.id group by c.cource) as child
join `student` as a join `achievement` as b join `course` as c on a.sex = 1 and b.sid=a.id and b.cid=c.id where child.abc=b.point and child.cource=c.cource
很繁瑣,子查詢和查詢的都是同一個表同一個條件,答案包對
不要姓名要學號的話就把名字換一下
原理
子查詢出最高分和科目,再用父查詢把(同條件下)把最高分和科目配對
Ⅳ sql查詢學生成績表最高分數
selecta.*
fromstudentasa,
(selectsubject,max(score))asb
wherea.subject=b.subjectanda.score=b.maxscore
Ⅳ 請問SQL 查詢出成績最高分
請問SQL 查詢出成績最高分
select 姓名,課程名,成績 from tablename where 成績=(select max(成績) from tablename)
Ⅵ 每個學生有不同成績,sql查詢最高成績的排名
1.每個學生可以是參加了一次或者多次的考試,對吧?
2.你是使用什麼資料庫?MySQL?Oracle?SQLServer?
3.若學生中最高的成績都是相同的分數,如何排名?是給相同的名次還是依舊隨機增序的方式排序?
Ⅶ SQL怎麼查詢分數最高的那條紀錄
select top 1 * from stumark order by totalmark desc
降序排列取第一個