I need the help from the community to solve the following problem that I found (I'm using SQL Server):
I have two tables, USER and INFO.
USER:
ID NAME
----------
AAA John
BBB Mike
INFO:
ID CONTANCT_INFO CONTACT_DESC
-------------------------------------
AAA 111111 Phone
AAA 222222 Mobile
AAA [email protected] Email
AAA [email protected] Email
BBB 333333 Phone
BBB [email protected] Email
BBB [email protected] Email
BBB [email protected] Email
BBB 444444 Phone
BBB 555555 Mobile
I want to merge the info table per user in one row as follows:
ID NAME Phone1 Phone2 Phone3 Email1 Email2 Email3
---------------------------------------------------------------------------
AAA John 111111 222222 [email protected] [email protected]
BBB Mike 333333 444444 555555 [email protected] [email protected] [email protected]
I've been trying many options and also surfing through stackoverflow posts, but without any results to my situation.
Thanks in advance!
Kind regards,
Aovon.
