Pivoting Help

  • Hello

    Please help me to do this

    CREATE TABLE #X1

    (vcEmployeeUniqueID VARCHAR(20),

    vcLastName VARCHAR(20),

    vcFirstName VARCHAR(20),

    vcSchoolName VARCHAR(50),

    iSchoolYearCode INT)

    INSERT INTO #X1 VALUES ('001210214','Miller','Helen','NORWALK HIGH SCHOOL',2009)

    INSERT INTO #X1 VALUES ('001210214','Miller','Helen','STAMFORD HIGH SCHOOL',2010)

    INSERT INTO #X1 VALUES ('001210214','Miller','Helen','NORWALK HIGH SCHOOL',2011)

    INSERT INTO #X1 VALUES ('003215847','Carolyn','June','NORWALK HIGH SCHOOL',2010)

    INSERT INTO #X1 VALUES ('003215847','Carolyn','June','WATERBURY HIGH SCHOOL',2011)

    INSERT INTO #X1 VALUES ('002149013','Steve','Ulman','STAMFORD HIGH SCHOOL',2011)

    Desired output will be

    vcEmployeeUniqueIDvcLastNamevcFirstNameSY2009SY2010SY2011

    001210214MillerHelenNORWALK HIGH SCHOOLSTAMFORD HIGH SCHOOLNORWALK HIGH SCHOOL

    003215847CarolynJuneNORWALK HIGH SCHOOLWATERBURY HIGH SCHOOL

    002149013SteveUlmanSTAMFORD HIGH SCHOOL

  • No need in duplicating your posts!

    http://www.sqlservercentral.com/Forums/Topic1384158-392-1.aspx

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply