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

SQL语句 合并列值 将一列的多个值合并成一行

效果:

技术分享图片

 

 

 技术分享图片

 

 

oralce写法:

select WM_CONCAT(A.title) as citys from tmpcity A

 

sql server写法:

select stuff((select ‘,‘+A.title from tmpCity A FOR xml PATH(‘‘)), 1, 1, ‘‘) as citys

 

mysql写法:

select GROUP_CONCAT(A.title) as citys from tmpcity A;      --默认的逗号分隔
select GROUP_CONCAT(A.title SEPARATOR  ‘ ‘) as citys from tmpcity A;   --用空格分隔

SQL语句 合并列值 将一列的多个值合并成一行

标签:mysq   分享图片   bsp   city   div   sql语句   alt   空格   oralce