输入banner图图片脚本导航/分类

Mysql concat() group_concat()用法

order by column asc/desc separator ‘分隔符‘ ) 最关键的是红色部分  其他可选 distinct去除重复值  order by column 按照 column排序ssc升序 desc降序

测试:如下

select id,name,group_concat(hobby separator ‘,‘) as occu from test group by name

技术图片

 

 

 首先把hobby换成数字 方便测试 排序

技术图片

 

 

 select id,name,group_concat(hobby order by hobby asc separator ‘,‘) as occu from test group by name

技术图片

 

 

  select id,name,group_concat(hobby order by hobby desc separator ‘,‘) as occu from test group by name

技术图片

 

 

 select id,name,group_concat(distinct hobby order by hobby asc separator ‘,‘) as occu from test group by name

技术图片

 

Mysql concat() group_concat()用法

标签:bsp   tor   obb   lazy   mic   排序   with   分隔符   图片