Cname Iyear Ivalue
A 1999 100
B 2000 125
A 2001 150
A 2000 100
A 2001 150
B 2003 500
等等......
连接到MYSQL并在A TABLE中获取输出,如下所示。
1999 2000 2001 2003
A 100 100 300
B 125 500
答案 0 :(得分:-1)
这可能会对你有所帮助:
select Cname,group_concat(Iyear) as Iyear,group_concat(Ivalue) as Ivalue from table group by Cname order by Iyear asc