Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6956475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:52:28+00:00 2026-05-27T14:52:28+00:00

I have a set of data like this: MinNo: 2500 MaxNo: 2700 IncrementStep: 10

  • 0

I have a set of data like this:

MinNo: 2500
MaxNo: 2700
IncrementStep: 10

Between the minimum number and the maximum number a list of all possible numbers with the given step are to be listed as shown below:

2500
2510
2520
2530
2540
2550
2560
2570
2580
2590
2600
2610
2620
2630
2640
2650
2660
2670
2680
2690
2700

I’m aware that this can be achieved using a while loop. Kindly let me know if this can be done using a select query using Common Table Expressions (if needed). Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:52:29+00:00Added an answer on May 27, 2026 at 2:52 pm

    You can use a numbers table (or master..spt_values).

    declare @MinNo int
    declare @MaxNo int
    declare @IncrementStep int
    
    set @MinNo = 2500
    set @MaxNo = 2700
    set @IncrementStep = 10
    
    select @MinNo + Number * @IncrementStep
    from master..spt_values
    where type = 'P' and
          number between 0 and (@MaxNo - @MinNo) / @IncrementStep
    

    Or a recursive CTE

    ;with C as
    (
      select @MinNo as Num
      union all 
      select Num + @IncrementStep
      from C
      where Num < @MaxNo
    )      
    select Num
    from C
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a data set like this: structure(list(var1 = c(APE, APE, APE, APE, APE,
I have set up a php script to receive url data like this: http://giffgaff.liamwli.co.uk/?name=liamwli
I have a set of data that is structured like this: ItemA.GroupA ItemB.GroupA ItemC.GroupB
I have a data set like this: boolean name value 0 Text10 20 1
I have a set of data that looks like this when using print_r($var) :
I have a set of data that looks like this col1 col2 col3 col4
I have a treeview populating from a data set like this Dim PrSet As
In a large data set I have some data that looks like this: guide
I have a set of data that looks like this, species<-ABC ind<-rep(1:4,each=24) hour<-rep(seq(0,23,by=1),4) depth<-runif(length(ind),1,50)
I have a list of dictionaries that each have data like this: 'Caitlyn': {'date':

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.