Home >Backend Development >PHP Tutorial >MySQL (C API) VC example and code download (1) (2)_PHP tutorial
10. SQL statement skills
1. A SQL statement problem: row and column conversion
select * from v_temp
The above view results are as follows:
user_name role_name
-------------------------
System Administrator Administrator
feng Administrator
feng General User
test General User
I want the result to be like this:
user_name role_name
--------------------------
System Administrator Administrator
feng administrator, general user
test general user
===================
create table a_test(name varchar(20),role2 varchar(20))
insert into a_test values('李','management