UPDATE query question

  • I'm talking about a clustered index on field8 and a nonclustered index like

    CREATE NONCLUSTERED INDEX ncindx1 ON table1 (field3,field2) include (field1)



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Maybe I need another cup of coffee, but I don't see how ROW_NUMBER can help with this classic 'running totals' type of scenario. Best bet for that is actually a cursor given that SQL Server doesn't (yet) have full support for windowing functions. 🙁

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

  • TheSQLGuru (5/6/2011)


    Maybe I need another cup of coffee, but I don't see how ROW_NUMBER can help with this classic 'running totals' type of scenario. Best bet for that is actually a cursor given that SQL Server doesn't (yet) have full support for windowing functions. 🙁

    Based on the subquery SELECT count(*) + 1 FROM table1 o WHERE field2 > o. field2 joining back to the original table and therewith building a triangular join I concluded this is a ROW_NUMBER scenario rather than a running total issue.

    The result set would be a consecutive number assigned to each row.

    Table def, sample data and some expected results would have been better though in order to verify we're on the right track. As per now sample data and expected results are still missing.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

Viewing 3 posts - 16 through 17 (of 17 total)

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