select *
from (select t.*,
ROW_NUMBER() over(partition by stunum, stuname order by mark desc) rn
from temp_marks t)
where rn = 1
------解决方案--------------------
SQL code
select t.stunum,t.stuname,max(mark) mark
from t
group by t.stunum,t.stuname
------解决方案--------------------
------解决方案-------------------- select stunum, stuname,max(mark) from table group by stunum, stuname