Test

0

Please login or register to vote for this query.

(click on this box to dismiss)

Movies and TV Meta

Q&A about the site for movie and tv enthusiasts

CREATE table #yourtable
    ([Date] varchar(12), [FullFile] varchar(6), [Count] varchar(13))
;
    
INSERT INTO #yourtable
    ([Date], [FullFile], [Count])
VALUES
    ('2020-06-02', 'John', '32'),
    ('2020-06-02', 'Jane', '4'),
    ('2020-06-01', 'John2', '244'),
    ('2020-06-01', 'Jane2', '23'),
    ('2020-05-31', 'John3', '45')
;


select Firstname, Amount, PostalCode, LastName, AccountNumber
from
(
  select FullFile, Date
  from #yourtable
) d
pivot
(
  max(FullFile)
  for Date in (Firstname, Amount, PostalCode, LastName, AccountNumber)
) piv;

Enter Parameters

Options:
Switch sites:
loading Hold tight while we fetch your results