sql 把行转换成合并列

wmsys.wm_concat //数据库内部函数:把多行转换成一合并列

e.x: select b.fchannel_id from sinocms_bindle_channel b where b.channel_id='1000000027'

结果:

1 1000000029

2 1000000030

3 1000000031

4 1000000032

5 1000000033

6 1000000034

select wmsys.wm_concat(b.fchannel_id) from sinocms_bindle_channel b where b.channel_id='1000000027'

结果:1000000029,1000000030,1000000031,1000000032,1000000033,1000000034

你可能感兴趣的:(sql)