Work out which column value is repeated the most

  • In my scenario - to stick with the data structure I posted (as opposed to my 'real-world' issue mentioned above) - if I ended up with the situation that OrganisationID 1 has three entries for LocationID 5 and three entries for LocationID 7 - it means 'both locations are in use and have been used an equal amount' ... I need to choose one, I have no reason to choose one over the other ... so just pick one of them.

    Which the code solution does - so it works fine for me.

  • sku370870 (3/2/2012)


    I need to choose one, I have no reason to choose one over the other

    I'll never understand such scenarios. Glad you're all set.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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