发布网友 发布时间: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
这样行不?凭想象写的,请参考