dense_rank()

  • Hello,

    It is possible to use dense_rank() function such that rank to begin with a specified ID ?

    Thank you.

    G.

  • dense_rank, like all the windowing functions like row_number,ntile and rank all start with one, so just add your some number to it to get your starting number

    select

    dense_rank() over (order by object_id) + 428600 As Val, *

    from sys.columns

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Tks.

    G.

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

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