这条sql语句怎么写?
A表的字段以及记录如下:
usercode time expendtime projcode
zhangsan 2012-5-10 5 proj1
lisi 2012-4-12 8 proj2
wangwu 2012-5-10 5 proj3
zhaoliu 2012-4-20 3 proj4
zhangsan 2012-5-10 5 proj2
zhaoliu 2012-5-15 6 proj6
我想得到下面的结果
usercode projs sum(expendtime)
zhangsan proj1、proj2 10
lisi proj2 8
wangwu proj3 5
zhaoliu proj4、proj6 8
该怎么写sql,关键是中间那一列?
------解决方案--------------------
SQL code
select usercode,wm_concat(projcode),sum(expendtime)
from t
group by usercode;