---
title: "Oracle-使用wmsys.wm_concat把行转换成合并列"
author: "fjfj910"
date: "2011-05-25T19:47:10Z"
tags: []
categories: ["数据库"]
slug: "oracle-wmsys-wm-concat"
draft: false
lastmod: "2011-05-25T19:47:10Z"
id: 1058599
url: "https://fjfj910.iteye.com/blog/1058599"
---

wmsys.wm\_concat //数据库内部函数：把多行转换成一合并列

例如:

1. 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

 

 把多行转换成一合并列

1. select wmsys.wm\_concat(b.fchannel\_id) from sinocms\_bindle\_channel b where b.channel\_id='1000000027'

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