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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:48:23+00:00 2026-05-26T14:48:23+00:00

I have 2 tables: mysql> describe solution_sections; +———————+—————+——+—–+———+—————-+ | Field | Type | Null

  • 0

I have 2 tables:

mysql> describe solution_sections;
+---------------------+---------------+------+-----+---------+----------------+
| Field               | Type          | Null | Key | Default | Extra          |
+---------------------+---------------+------+-----+---------+----------------+
| solution_section_id | int(10)       | NO   | PRI | NULL    | auto_increment |
| display_order       | int(10)       | NO   |     | NULL    |                |
| section_name        | varchar(1000) | YES  |     | NULL    |                |
+---------------------+---------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)

mysql> describe suggested_solution_comments;

+-----------------------+----------------+------+-----+---------+----------------+
| Field                 | Type           | Null | Key | Default | Extra          |
+-----------------------+----------------+------+-----+---------+----------------+
| comment_id            | int(10)        | NO   | PRI | NULL    | auto_increment |
| problem_id            | int(10)        | NO   |     | NULL    |                |
| suggested_solution_id | int(10)        | NO   |     | NULL    |                |
| commenter_id          | int(10)        | NO   |     | NULL    |                |
| comment               | varchar(10000) | YES  |     | NULL    |                |
| solution_part         | int(3)         | NO   |     | NULL    |                |
| date                  | date           | NO   |     | NULL    |                |
+-----------------------+----------------+------+-----+---------+----------------+

What I am trying to do is to display the list of section_name from the solution_sections table. It only has about 10 rows in it. And for every section name, to get the list of suggested_solution_comments associated with it.

The tables are linked by suggested_solution_comments.solution_part and solution_sections.solution_section_id

Here is what I am trying so far:

select section_name , comment , solution_part , display_order from solution_sections 
    left join suggested_solution_comments on 
    solution_sections.solution_section_id = suggested_solution_comments.solution_part   
    where suggested_solution_id = 188
    group by display_order;

But that returns nothing when there are no comments. But even if there are no comments, I’d like to still display the list of section_names from the solution_sections table.

Thanks!!

  • 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-26T14:48:24+00:00Added an answer on May 26, 2026 at 2:48 pm

    The problem is here:

    where suggested_solution_id = 188

    Your query requires the suggested_solution_id have a value of 188, which will never be true for records that have no comments. Try adding in this:

    OR suggested_solution_id IS NULL

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 tables: mysql> describe solution_sections; +---------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null
I have 4 tables: mysql> describe solution_sections; +---------------------+---------------+------+-----+---------+----------------+ | Field | Type | Null
I have the following 2 tables.. mysql> describe catalog_category_reference; +----------+---------+------+-----+---------+----------------+ | Field | Type
I have two associated tables (simplified schema) mysql> describe booking; +----------------+------------+ | Field |
so i have this table; mysql> describe player_weapon_stats; +------------+------------------+------+-----+---------+----------------+ | Field | Type |
Hi i ve got two tables like this: mysql> describe tb_data_iae; +--------------------+--------------+------+-----+---------+----------------+ | Field
--EDITED TO BETTER DESCRIBE THE SCENARIO-- I have a MySQL database containing 2 tables,
I have two mysql tables, one containing details on cars and one containing all
i have two mysql tables tableA colA1 colA2 1 whatever 2 whatever 3 whatever
I have this mysql tables I want to display with jqgrid. The problem appears

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.