数据库
首页 > 数据库> > mysql中有group_concat()可以合并多行

mysql中有group_concat()可以合并多行

作者:互联网

select group_concat(CONCAT('if(isnull(',COLUMN_NAME,'),1,0) as ' ,COLUMN_NAME) ) as name ,'aa' as gao from INFORMATION_SCHEMA.COLUMNS
where table_schema='ht_wind' and TABLE_NAME='CBONDBALANCESHEET' 

 

mysql中有group_concat()可以合并多行内容,类似于 sqlserver中for xml path

select AID,ANAME,(
select group_concat(VALUE) from B where B.AID=A.AID
) as AVALUE from A;

标签:group,NAME,COLUMN,mysql,AID,concat
来源: https://www.cnblogs.com/gina11/p/15427616.html