开发者

SQL Query to get the following output

开发者 https://www.devze.com 2023-03-12 22:51 出处:网络
Select * 开发者_高级运维from table1 col1col2 AAAACE BBBMK AllOUT AllIN KKKBA CCCNA KKKIN I need output as below:

Select * 开发者_高级运维from table1

col1   col2

AAAA    CE      
BBB     MK     
All     OUT
All     IN
KKK     BA
CCC     NA
KKK     IN

I need output as below:

AAAA : CE
BBB : MK
All : OUT,IN
KKK : BA, IN
CCC : NA


If this is MySQL, you can use GROUP_CONCAT function

0

精彩评论

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