简单SQL语句,查询成绩

发布网友 发布时间:2022-04-25 05:41

我来回答

4个回答

热心网友 时间:2023-10-30 23:26

select a.ID,a.姓名,b.科目,b.分数 from xs a,(select 科目,max(分数) 分数 from xs group by 科目) b where a.科目=b.科目 and a.分数=b.分数

热心网友 时间:2023-10-30 23:27

select a.* from xs a,
(select 科目,max(分数) '分数' from xs
group by 科目) b
where a.科目=b.科目 and a.分数=b.分数
order by a.科目,a.id

热心网友 时间:2023-10-30 23:27

SELECT * FROM xs WHERE NOT EXISTS (SELECT 1 FROM xs B where xs.科目=B.科目 AND xs.分数 <B.分数

热心网友 时间:2023-10-30 23:28

select * from xs
inner join
(
select km,max(fs) as fs from xs group by km
)w
on xs.km = w.km and xs.fs = w.fs

这样行不?凭想象写的,请参考

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com