You need to unpivot the columns of data in the sets of 3 each. If you are using SQL Server 2005+, then you can use CROSS APPLY to get the result:
select col_1, col_2, col3
from yourtable
cross apply
(
select custname, locname, state union all
select zip, comments1, comments2
) c (col_1, col_2, col3)
order by uid;
Note, the datatype must be the same on the columns you are placing together, for example if zip
was an int
, then you would have to convert it to a varchar
so you could place the data in the same column as custname
.