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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:02:44+00:00 2026-06-13T09:02:44+00:00

I have a table number_color_style with the structure as shown below. This table contains

  • 0

I have a table number_color_style with the structure as shown below.

Table Strcture

This table contains data as shown below(8 rows)

Table Data

What I want as I output is All records grouped by number_color_id , number_style_id

I tried below query

SELECT *
FROM `number_color_style`
GROUP BY `number_color_id` , `number_style_id`

It gives me output but some rows are missing

Result

What I want is four set of data without missing a single row(should contain all 8 rows).
EG:

  • 1st set where number_color_id = 1 , number_style_id = 1
  • 2nd set where number_color_id = 1 , number_style_id = 2
  • 3rd set where number_color_id = 2 , number_style_id = 1
  • 4th set where number_color_id = 2 , number_style_id = 2

How can I do it ?

Create table query

CREATE TABLE IF NOT EXISTS `number_color_style` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `img` varchar(100) NOT NULL,
  `number_color_id` int(11) NOT NULL,
  `number_style_id` int(11) NOT NULL,
  `number_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
);

Some sample data

INSERT INTO `jink`.`number_color_style` (`id`, `img`, `number_color_id`, `number_style_id`, `number_id`) VALUES (NULL, 'img1.png', '1', '1', '10'), (NULL, 'img2.png', '1', '1', '10'), (NULL, 'img3.png', '1', '2', '10'), (NULL, 'img4.png', '2', '1', '10'), (NULL, 'img5.png', '2', '1', '10');
  • 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-13T09:02:47+00:00Added an answer on June 13, 2026 at 9:02 am

    If you want to display all 8 set according to number_color_id and number_style_id, should use order by instead of group by.

    SELECT *
    FROM `number_color_style`
    ORDER BY `number_color_id` , `number_style_id`
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In each table have many number of rows with amount. Like this i have
I have table with following structure and test records: +--------+--------+---------+ | vid | number
I have a table like: id number year I want to find holes, or
I have table in data base name train delay, with columns train number(int), DelayTime(int),
I have a table and I am inserting a new row dynamically. It contains
i have a table in which every rows have a checkbox associated with the
I have problem in which I have some rows which I want there to
I have a form that looks like this: <form id=addClassesToDoc action=> <table id=classesTable style=border-collapse:
I have a task of sorting the table row in a table. The data
I have a table like this: Table name: PRODUCT ID PRODUCTID PRODUCTNAME 1 D100

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.