Convert Row to Column in SQL Server

Last Reply 19 days ago By pandeyism

Posted 19 days ago

hello,

i have table structure like

Table 1

id  username

1     dharmendra

2      mudassar

Table 2

username   address

dharmendra     abc

dharmendra     bcd

dharmendra     efg

mudassar        abc

mudassar        bcd

so i want that row should be cover to column in SQL query like this

user name address 1 address2 address3 address4  so on if more addres

dharmendra    abc      def           ghi         efg

mudassar       abc        bcd