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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:50:20+00:00 2026-06-04T02:50:20+00:00

3 tables table: people id name 1 john 2 Mike 3 Sam 4 Andy

  • 0

3 tables

table: people 

id name 
1  john  
2  Mike
3  Sam  
4  Andy 

–

table goods:

   g_id g_name  g_class
    1   sugar  food
    2   salt   food
    3   boat   transp
    4   house  habitation
    5   car    transp

–

   table goods_owned:
      go_id person_id   good_id
        1   3           3
        2   3           1
        3   3           5
        4   2           4
        5   1           2

Now when i select

SELCT people.id, people.name, goods.name
   FROM people
      LEFT JOIN goods_owned ON goods_owned.person_id = people.id
      LEFT JOIN goods ON goods.g_id = goods_owned.good_id
         WHERE people.id = 3

Then in response it duplicates entry’s from table “people”:

1, Mike, boat
1, Mike, sugar
1, Mike, car

Is there way to build request to get:

1, Mike, boat, sugar, car
  • 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-04T02:50:21+00:00Added an answer on June 4, 2026 at 2:50 am

    Yes, look at GROUP_CONCAT, which collects all the values for each GROUP BY and comma-separates them.

    SELCT people.id, people.name, GROUP_CONCAT(goods.name)
    FROM people
    LEFT JOIN goods_owned ON goods_owned.person_id = people.id
    LEFT JOIN goods ON goods.g_id = goods_owned.good_id
    WHERE people.id = 3
    GROUP BY people.id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables table: people id name goods_owned 1 john 1,4,3 2 Mike
I have two tables, like these: Table People: VARCHAR Name INTEGER Age Table Message
Lets say I have the following (2) tables: [People Table] ID   Name 1
So I have a table people which is like this Id Name 1 John
I have two tables people name id man1 456 man2 123 man3 789 notes
I have two tables people name id man1 456 man2 123 man3 789 notes
given the two tables and values: Tables People- Columns: [ID]PK Name Field - Columns:
Simple and fast question, i have those tables: //table people | pe_id | pe_name
Say I have these tables: people(id, name), cars(person_id, car) and this query: SELECT c.car
I have a table named People in the following format: Date | Name .

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.