Help with Update Query

  • want some script to return the "Result".

    The result is based on the ranks of all others rows not belonging to "LEVEL1".

    FEILD1LEVEL1SCORERankResult

    100001AAAA112345789

    100001AAAA262345789

    100001BBBB12146789

    100001BBBB23146789

    100001BBBB35146789

    100001CCCC141235678

    100001CCCC291235678

    100001DDDD471234569

    100001DDDD581234569

    Help is most appreciated.

  • Maybe this?

    select a.FEILD1,a.LEVEL1,a.SCORE,a.Rank,

    (select b.Rank as "text()"

    from mytable b

    where b.LEVEL1<>a.LEVEL1

    order by Rank

    for xml path('')) as Result

    from mytable a

    ____________________________________________________

    Deja View - The strange feeling that somewhere, sometime you've optimised this query before

    How to get the best help on a forum

    http://www.sqlservercentral.com/articles/Best+Practices/61537
  • SSC Veteran

    'Spot On' thanks for your help most appreciated.

    Gary

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

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