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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:14:29+00:00 2026-06-17T08:14:29+00:00

I have 2 tables join by Many-to-Many relationship, I create the 3rd table, and

  • 0

I have 2 tables join by Many-to-Many relationship, I create the 3rd table, and I have a query like this one :

SELECT  product.product_name, provider.provider_name 
FROM  product, provider, provider_product 
WHERE product.id_product = provider_product.ref_product 
AND provider.id_provider = provider_product.ref_provider 

I need to group my result by product_name and the result must be in the same line, like that : if a product have a lot of providers :
my result will be :

product.product_name | provider.provider_name
this is my first product 1   | this is provider1 / this is provider2 / this is provider3 

As you see, Providers are in the same line, and they are splitting by /

  • 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-17T08:14:30+00:00Added an answer on June 17, 2026 at 8:14 am

    Use the GROUP_CONCAT() function.

    SELECT  product.product_name, GROUP_CONCAT(provider.provider_name SEPARATOR '/') 
    FROM  product, provider, provider_product 
    WHERE product.id_product = provider_product.ref_product 
    AND provider.id_provider = provider_product.ref_provider 
    GROUP BY product.product_name
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a one-to-many relationship modeled using join table: create table t1 (id int
Let's say I have two tables with a one-to-many relationship. I want to create
In a MySQL database I have two tables linked in a join. One table
I have 2 related MySQL tables in a one to many relationship. Customers: cust_id,
So i have the two tables (Product and Supplier) connected through a many-to-many relationship.
I have table customer and table contract with one-many relationship (1 customer has many
I have two tables in a one to many relationship. (products and qty break
I have two tables: Item and ItemHistory with a one to many relationship. I
I have two tables, Table_A and Table_B. Table_A has a one-to-many relationship with Table_B.
I want to create conditional join to a table in my T-SQL query. Tables

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.