phpfly
(phpfly)
注册会员

初级会员
UID 68917
精华
0
积分 70
帖子 55
金钱 70 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-2-27
状态 离线
|
[推荐阅读] 请问如何获取来路截获路径
QUOTE: 原帖由 millken 于 2008-5-16 03:14 PM 发表
试试这样,没经过验证.
select user,sum(mark),(select sum(mark) from result r1 where question_type=1 and r1.user=r.user) type1,(select sum(mark) from result r2 where question_type=2 and r2.user=r.user)type2,(select sum(mark) from result r3 where question_type=3 and r3.user=r.user)type4,(select sum(mark) from result r4 where question_type=4 and r4.user=r.user)type4 from result r group by user order by sum(mark) desc 谢谢,我来试试~~
|
|