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.
Author |
Topic |
Syima
Starting Member
13 Posts |
Posted - 2007-10-02 : 02:56:07
|
Hi thereAssuming this is the query used to return this result:select dept.name, count(prj.id) from department dept, project prj where prj.id = dept.uid group by dept.nameDept, TotalProjA , 10B , 5C , 2Question: How do I change the query so that the result will return as follows:Dept/TotalProj A, B, C10, 5, 2 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-10-02 : 03:05:06
|
Are you using SQL Server 2005? Try out PIVOT keyword. E 12°55'05.25"N 56°04'39.16" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
Syima
Starting Member
13 Posts |
Posted - 2007-10-02 : 03:12:16
|
yes, i'm using sql 2005-query analyzer to check my sql syntax, but i will have to translate it to another N-Niku SQL which is used in Clarity software. I'm afraid the keyword PIVOT is not recognized/supported in N-SQL. Is there other way to change the query? |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-10-02 : 03:32:50
|
Click to link provided above and look carefully for yellow hightlighted words.Read the topics marked with yellow. E 12°55'05.25"N 56°04'39.16" |
 |
|
jackv
Master Smack Fu Yak Hacker
2179 Posts |
|
|
|
|
|
|