行转列
SQL> select * from test;ID MC---------- -------------1 111111 222222 111112 222223 111113 222223 33333已选择7行。SQL> select id,ltrim(max(sys_connect_by_path(mc,',')),',') row2colfrom (select id,mc,id+(row_number() over(order by id)) node_id,row_number() over(partition by id order by id) rnfrom test)start with rn = 1connect by node_id-1 = prior node_idgroup by idorder by id;ID ROW2COL---------- -------------------------------------------------------------1 11111,222222 11111,222223 11111,2