gwarcher
asked on
SQL Server or Excel - transpose columns to rows
I have a table that looks like this:
District Code SubDistrict1 SubDistrict2 Subdistrict3
A 11 Apple Orange Pear
B 131 Banana Wood Desert
C 53 Apple Salt Pepper
And I need it to look like this:
District Code Subdistrict
A 11 Apple
A 11 Orange
etc...
C 53 Apple
etc...
Normally this would be simple but I have thousands of rows with several hundred different codes. Is there a simple automated way to lay this out in SQL?
District Code SubDistrict1 SubDistrict2 Subdistrict3
A 11 Apple Orange Pear
B 131 Banana Wood Desert
C 53 Apple Salt Pepper
And I need it to look like this:
District Code Subdistrict
A 11 Apple
A 11 Orange
etc...
C 53 Apple
etc...
Normally this would be simple but I have thousands of rows with several hundred different codes. Is there a simple automated way to lay this out in SQL?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER