Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can PIVOT do this ?
Message
 
 
À
18/05/2010 09:02:48
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Divers
Thread ID:
01464982
Message ID:
01464999
Vues:
23
>>Sure, try:
>>
>>select RowID, [1] as Column1, [2] as Column2 from myTable PIVOT (Min(ID) for ColumnID in ([1],[2])) pvt
>>
>>from the top of my head - not tested.
>
>Min() won't work with uniqueidentiifer :-{

Is it the structure you have?
declare @t table (Id int primary key, ColumnId uniqueidentifier, RowId uniqueidentifier)
insert into @t values (1, NEWID(), NEWID()),(2, NEWID(), NEWID()),(3, NEWID(), NEWID()),(4, NEWID(), NEWID())
select * from @t
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform