當前位置:首頁 » 編程語言 » 成績最高sql查詢

成績最高sql查詢

發布時間: 2022-03-15 21:07:24

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
降序排列取第一個

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:585
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:881
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:574
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:761
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:676
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1005
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:249
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:108
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:798
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:705