开发者

select where column1 are equals

开发者 https://www.devze.com 2023-01-18 05:44 出处:网络
I am using Oracle 10.2.0 and I am new with it. I need a sql Statement I have开发者_如何学Python a table with 3 columns. in the column1 are numbers and same of them have equals values in column2 and c

I am using Oracle 10.2.0 and I am new with it. I need a sql Statement

I have开发者_如何学Python a table with 3 columns. in the column1 are numbers and same of them have equals values in column2 and cloumn3 are String. How can I get the Strings from column2 and column3 together separated with ";" when Numbers from column1 are equals.

thanks


Ïf you have access to the analytical functions:

SELECT column1, LISTAGG(column2, ',') WITHIN GROUP (ORDER BY column2) AS ConcatedValues
FROM   table
GROUP BY column1;
0

精彩评论

暂无评论...
验证码 换一张
取 消