Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Display data in transpose form

Author  Topic 

Adianjali
Starting Member

7 Posts

Posted - 2011-02-08 : 02:20:11
My query is giving folling output

First_Name Last_Name
Raj Malhotra
Prem Chopra

The above is fine
But i want to display in below format

First_Name Raj Prem
Last_Name Malhotra Chopra




arjun.s

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2011-02-08 : 04:01:07
try using pivot table.
Go to Top of Page

Ranjit.ileni
Posting Yak Master

183 Posts

Posted - 2011-02-08 : 04:58:22
can you provide table structure for more clarity

--Ranjit
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2011-02-08 : 05:44:30
It's not a good job for sql server. You should do it in whatever consuming application you use.

In your calling app this would be a really simple loop.

There are ways to do it in sql server but they are awkward and not what the engine is designed to do.

Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page
   

- Advertisement -