• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 529
  • Last Modified:

SQL Query - auto increment

Hello experts,

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

Example:

10    Bob Anderson
20    Jason Souler
30    Deb Kyle
40    Thomas Jaeger
0
holemania
Asked:
holemania
  • 2
1 Solution
 
Roman GhermanCommented:
You can set the identity increment  to 10, see screenshot AutoIncrement10
0
 
holemaniaAuthor Commented:
I'm doing a select from.  I need to increment a value that doesn't exists in the table.  
0
 
ralmadaCommented:
select col1, col2, (row_number() over (order by col1)) * 10 as rn from yourtable
0
 
holemaniaAuthor Commented:
Awesome.  Thank you.
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now