1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Convert rows of users to dynamic number of columns

Discussion in 'Programming/Internet' started by matthew herb, Sep 12, 2018.

  1. matthew herb

    matthew herb Guest

    I have a table like

    ACCOUNT REP
    Tradewind Bob
    Tradewind Joe
    Tradewind Rick
    Headlands Joe
    Headlands Bob


    And I want to turn that into

    ACCOUNT REP1 REP2 REP3
    Tradewind Bob Joe Rick
    Headlands Bob Joe NULL


    I have bring trying to figure this out and understand it is some sort of use of the PIVOT keyword. Maybe uses the SELECT OVER somehow ?

    Login To add answer/comment
     

Share This Page