Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can PIVOT do this ?
Message
 
 
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
01464982
Message ID:
01464999
Views:
24
>>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
Previous
Reply
Map
View

Click here to load this message in the networking platform