• LoveSQL (3/10/2009)


    Hi,

    Can some one help me writing the following query?

    Update the Seq numbers in the table below. Seq numbers must be ordered by their CreateDate and reset for each distinct AccountNbr, as seen below

    BTW, without using RANK or Row_NUMBER

    AccountNbrSeqCreateDate

    59961101/05/09

    59961201/06/09

    59961301/07/09

    32187101/05/09

    32187201/06/09

    22195101/10/09

    22195201/12/09

    22195301/13/09

    22195401/15/09

    69248101/11/09

    69248201/12/09

    Yep... but ya gotta tell me, why does the requirement to NOT use Row_Number or Rank exist?

    --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)