Home > Database > Mysql Tutorial > 列转行

列转行

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:05:17
Original
1117 people have browsed it

test: c1 c2 1 a 1 b 2 c select to_char(wmsys.wm_concat(c2)) , to_char(replace(wmsys.wm_concat(c2),,,/)) from test group by c1 show case: 1 a,b a/b 2 c c 同样的功能函数: select listagg(c2,,) within group(order by c1) from test ;

test:

c1 c2

1 a

1 b

2 c

select
to_char(wmsys.wm_concat(c2)) ,
to_char(replace(wmsys.wm_concat(c2),',','/'))

from
test

group by
c1

show case:

1 a,b a/b

2 c c

同样的功能函数:

select listagg(c2,',') within group(order by c1) from test ;

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template