Number Column

  • Hi Guys,

    How can I add an extra numbered column to my query?

    If I have a table A with following data:

    Table A

    AcctName varchar(25)

    AcctBegBal decimal(28, 6)

    Output needs to be numbered

    1 TFT001 10.00

    2 TFT001 75.00

    3 TRJ001 35.00

    Need query to generate number for sequence.

    J

  • It is not really clear what you're trying to accomplish, or why you're trying to accomplish it. A simple query to show what you've given here is:

    SELECT ROW_NUMBER() OVER (ORDER BY AcctName), AcctName, AcctBegBal FROM A

    But it is impossible to tell if this solves what you're actually asking. Look up BOL on ROW_NUMBER and IDENTITY columns for more information.

  • Thanks That works great!

    J

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

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