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 2005 Forums
 Transact-SQL (2005)
 PIVOT without aggregate

Author  Topic 

denfer
Starting Member

12 Posts

Posted - 2009-03-31 : 05:38:48
Hello
Is it possible to do a pivot without using aggregate ?
I have these data that comes from XML document :
  F1           F2
1 Language     FR
2 Translator   Tradutec
3 Reviewer     John
4 ProjectName  G87-Test-Mars01

I want this:
  Language Translator Reviewer ProjectName
1 FR         Tradutec   John      G87-Test-Mars01

Do you have any idea How I can do that ?

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2009-03-31 : 05:43:51
You'd better show us the content of XML document.



E 12°55'05.63"
N 56°04'39.26"
Go to Top of Page

denfer
Starting Member

12 Posts

Posted - 2009-03-31 : 06:16:22
here is the xml
<NewDataSet>
<Table>
<F1>Language</F1>
<F2>FR</F2>
</Table>
<Table>
<F1>Translator</F1>
<F2>Tradutec</F2>
</Table>
<Table>
<F1>Reviewer</F1>
<F2>John</F2>
</Table>
<Table>
<F1>ProjectName</F1>
<F2>G87-Test-Mars01</F2>
</Table>
</NewDataSet>

an other solution will be to transform the XML but I don't know very well DML
If I can convert this XML to this one I will get my solution:
<NewDataSet>
<Table>
<Language>FR</Language>
<Translator>Tradutec</Translator>
<Reviewer>John</Reviewer>
<ProjectName>G87-Test-Mars01</ProjectName>
</Table>
</NewDataSet>
Go to Top of Page

denfer
Starting Member

12 Posts

Posted - 2009-03-31 : 15:07:23
Nobody as an idea how to do that kind of Pivot ?
Go to Top of Page
   

- Advertisement -