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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T12:11:17+00:00 2026-06-09T12:11:17+00:00

I have a normal table: id |value 12 |1 24 |3 35 |20 ..and

  • 0

I have a normal table:

id |value
12 |1
24 |3
35 |20

..and so on to id lets say 100. I wonder if there’s a query to select all, but split the column into 3 equally-separated columns and numerate the 1st from 1 to 33, 2nd 34-66, 67-100 (or anything close to that logic)

expected output:
I don’t care about the ids so what need is something like

order1|value1  order2|value2 order3|value3
    1 |1           34|80          67|206
    2 |4           35|100         68|207
    3 |6           36|102         69|280
    ...            ....            ...
    33|60          66|201        100|810
  • 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-06-09T12:11:19+00:00Added an answer on June 9, 2026 at 12:11 pm

    I think this is what you are looking for:

    SELECT *
    FROM (
          SELECT (@var_count := @var_count + 1) AS order1, value AS value1, 0 order2, 0 value2, 0 order3, 0 value3
          FROM table_name, (SELECT @var_count := 0) a
          LIMIT 33
    
          UNION ALL
    
          SELECT 0 order1, 0 value1, (@var_count := @var_count + 1) AS order2, value AS value2, 0 order3, 0 value3
          FROM table_name, (SELECT @var_count := 33) a
          LIMIT 34, 33
    
          UNION ALL
    
          SELECT 0 order1, 0 value1, 0 order2, 0 value2, (@var_count := @var_count + 1) AS order3, value AS value3
          FROM table_name, (SELECT @var_count := 66) a
          LIMIT 67, 33
         )a;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to have a delete user link in a normal Activerecord table, but
I have a table like Id Value 1 Start 2 Normal 3 End 4
Let's say, I have a normal normalized database like this: CREATE TABLE `users` (
Imagine you have a normal table view where each row is an item on
Hello i have a products table that contains normal products and configurable product It
I have a table with expand/collapse javascript acting on the class value assigned to
I have SQL table that has a varchar(8) column that occasionally has binary data
I have a problem with a HQL query. I want to get all PID
I have a key => value table I'd like to sort in Lua. The
I have a form where users can search all the entries in a table

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.