set @sql = null;
select
group_concat(distinct
concat(
'max(if(cname = ''',cname,
''', score, 0)) as ''',
cname, ''''
)
) into @sql
from usercourse;
set @sql = concat('select uid as 学号, uname as 姓名,sum(score) as 总分, ', @sql,
' from usercourse where bid=1
group by uid ');
prepare stmt from @sql;
execute stmt;
deallocate prepare stmt;
请问大神 这个怎么换成Mysql的