Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-arrange data 'layout' in table

Status
Not open for further replies.

outofservice

Technical User
Feb 20, 2002
33
GB
I need to alter the way the data is stored within a table.

A typical row looks currently like this:

Col1 Col2 Col3 Col4
---- ------ ----- -----
XXXXX AAAAA BBBBB CCCCC

I need to 're-arrange' my table so that its displays thus:

Col1 Col2
---- -----
XXXXX AAAAA
XXXXX BBBBB
XXXXX CCCCC

Any ideas?
Lauryn Bradley
SQL Server DBA
 
Hi,

does this help

select col1,col2 from #t
union all
select col1,col3 from #t
union all
select col1,col4 from #t


Sunil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top