SQL Query - auto increment

Posted on 2011-04-27
Last Modified: 2012-05-11
Hello experts,

I need to generate a number that is auto increment by 10.  Not sure how to do this.


10    Bob Anderson
20    Jason Souler
30    Deb Kyle
40    Thomas Jaeger
Question by:holemania
    LVL 9

    Expert Comment

    by:Roman Gherman
    You can set the identity increment  to 10, see screenshot AutoIncrement10

    Author Comment

    I'm doing a select from.  I need to increment a value that doesn't exists in the table.  
    LVL 41

    Accepted Solution

    select col1, col2, (row_number() over (order by col1)) * 10 as rn from yourtable

    Author Closing Comment

    Awesome.  Thank you.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
    'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now