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
 SQL Server Columns

Author  Topic 

nregular
Starting Member

3 Posts

Posted - 2007-11-14 : 01:37:41
I have a question regarding sql.. can SQL server tranfer data from Row to Columns.

Example:
i have a transmittal or submission

Drawing Number Transmittal No. Transmittal Date

001 001 May 01, 2007
001 002 May 10, 2007
002 003 May 28, 2007
001 003 May 28, 2007


Should be:


Dwg /XTML/ Date / XTML /Date /XTML /Date
001 /001/ May 01/ 002 / May 10 /003 / May 28
i have a problem this for almost 6 months. pls help me....

Thx

Nino Aries Regular
Forssman Pacific Corporation

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-14 : 01:52:54
check out PIVOT in SQL Server 2005 provided that you are using 2005


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

nregular
Starting Member

3 Posts

Posted - 2007-11-14 : 01:58:06
what pivot - how can i see pivot in SQL

THX
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-14 : 02:43:00
read the Books On Line
http://msdn2.microsoft.com/en-us/library/ms177410.aspx


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

nregular
Starting Member

3 Posts

Posted - 2007-11-14 : 03:04:39
thx to all reply.. thx to all SQL Developer..

My question is automatic .. not to assign values automatic in rows to column... it is possible to use array in sql
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-14 : 03:30:34
Yes, it is called PIVOT.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -