sql query for select multiple columns in single column

Jul 17 2020 1:59 AM
i have one single table and in that table there are three columns company1,company2,company3.
below is my table data :
Hide Copy Code
Company1 Company2 Company3
ABC
Test1 Test3 Test5
Test2 Test4 Test6
testing testing2
and i want to combine these columns into single column with serial number like below :
Hide Copy Code
SrNo CompanyName
1 ABC
2 Test1
3 Test2
4 testing
5 Test3
6 Test4
7 testing2
8 Test5
9 Test6

Answers (4)