FJVN

0

Please login or register to vote for this query.

(click on this box to dismiss)

German Language Meta

Q&A about the site for speakers of German wanting to discuss the finer points of the language and translation

CREATE table #yourtable
    ([Id] int, [IndiceTalon] int, [Talon] varchar(3))
;
    
INSERT INTO #yourtable
    ([Id], [IndiceTalon], [Talon])
VALUES
    (1, 1, '202'),
    (2, 2, '204'),
    (3, 3, '186'),
    (4, 4, '203'),
    (5, 5, '205'),
    (6, 6, '207')
;


select Talon1,Talon2, Talon3, Talon4, Talon5, Talon6
from
(
  select IndiceTalon, Talon
  from #yourtable
) d
pivot
(
  max(Talon)
  for Talon in (Talon1,Talon2, Talon3, Talon4, Talon5, Talon6)
) piv;

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results