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
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Query Problem

Author  Topic 

Mythili
Starting Member

3 Posts

Posted - 2007-07-22 : 13:07:13
Dear All,

I am new to SQL server and SQL team too. I have a problem to write a query. Please give the solution.

Here is the records
id name city

1 Varsha A
2 Priti B
3 Sony C

I want the same like

id 1 2 3
name varsha Priti Sony
City A B C


Please forgive me if i am posted anything wrong in this forum

Thanks
Mythili

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2007-07-22 : 13:13:38
search for pivot or cross-tab around here.

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

Mythili
Starting Member

3 Posts

Posted - 2007-07-22 : 13:34:13
Spirit, Thanks. I have tried but I cannot write the query.Can you please help me

thanks
Mythili
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-07-22 : 14:01:36
You can copy and paste from the results you find.
Then you hve to alter the query to match the columns names and table name you have in your environment.


Peter Larsson
Helsingborg, Sweden
Go to Top of Page
   

- Advertisement -