
你好!
你写的确实有点复杂!
你可以分两步:
1 . 获取每个人每个学科的最新考试成绩
select b.name,b.class,b.score from score b,(select a.name,a.class,max(a.time) tims from score a group by a.name,a.class) a
where b.name = a.name
and a.class = b.class
and a.tims = b.time
2 . 进行行专列 *** 作
对上面的数据进行行列转化 *** 作,比较常见了!
欢迎追问,望采纳
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)