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 6094191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:38:55+00:00 2026-05-23T12:38:55+00:00

I have a table of integer, with two columns. col1 | col2 47 |

  • 0

I have a table of integer, with two columns.

  • col1 | col2
  • 47 | 99
  • 56 | 100
  • 100 | 110
  • 147 | 150
  • 156 | 160
  • 200 | 250
  • 247 | 300

Let’s say MySQL starts to read at col1, row1, the values are 47 and 99.
What I want MySQL to do, is to select data from col1 every values+100.
So here col1 starts at 47, MySQL should select
47
147
247

FYI : this table has about 500.000 rows. .. According to stats, this should return about 50,000 rows. So I need a super-fast query.

I had several attempt that didn’t work out, with smth like that:

    SELECT * 
      FROM ( 
           SELECT 
                @row := @row +100 AS rownum, col1
           FROM (SELECT @row :=0) r, my_table 
           ) ranked 
    WHERE rownum % [n] = 1
  • 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-23T12:38:55+00:00Added an answer on May 23, 2026 at 12:38 pm

    do something like

    SELECT * FROM mytable WHERE col1 % 100 = 
       (select col1 % 100 from mytable order by col1 limit 1)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets say I have these two tables: CREATE TABLE nodes ( id INTEGER PRIMARY
I have a table that contains the columns: employer_id contact_id primary First two are
I have a table similar to this: CREATE TABLE example ( id integer primary
I have a SQL Server 2005 table like this: create table Taxonomy( CategoryId integer
I have the following table schema; CREATE TABLE `db1`.`sms_queue` ( `Id` INTEGER UNSIGNED NOT
Suppose that I have two Hibernate POJOs: Customer and Order. The Order table has
I have the following rails migration: create_table :articles do |t| t.integer :user_id, :allow_null =>
I have table inside a div tab. The table has 40 rows in it
I have table with 50 entries (users with such details like Name Surname Location
I have table rows of data in html being filled from a CGI application.

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.