如何将多行转换为不同的列?

时间:2022-08-06 23:40:52

I have raw data like below

我有如下的原始数据

UserId Email Name Age
101    abc   xyz  30
101    def   xyz  30
101    ghi   xyz  30

and looking for output like below

并寻找下面的输出

UserId Email1 Email2 Email3 Name Age
101    abc    def    ghi    xyz  30

Raw data could have single or multiple emails, so I am trying to get a generic way of doing it. Right now I am struggling to get it done. Any help is much appreciated.

原始数据可能包含单个或多个电子邮件,因此我试图获得一种通用的方式。现在我正在努力完成它。任何帮助深表感谢。

1 个解决方案

#1


0  

Check the listagg function. It won't give you real columns, but you could make it look like it did by formatting the output accordingly.

检查listagg函数。它不会给你真正的列,但你可以通过相应地格式化输出使它看起来像它。

#1


0  

Check the listagg function. It won't give you real columns, but you could make it look like it did by formatting the output accordingly.

检查listagg函数。它不会给你真正的列,但你可以通过相应地格式化输出使它看起来像它。