;with C(A, B, C) as ( select 2,1,3 ) select [1],[2],[3] f...

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow

Q&A for programmers

;with C(A, B, C) as
(
  select 2,1,3
)
select [1],[2],[3]
from (
       select Val, row_number() over(order by Val desc) as rn
       from C unpivot (Val for Col in(A, B, C)) U
     ) T
pivot (min(val) for rn in ([1],[2],[3])) P

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results
:records returned in :time ms:cached