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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:54:46+00:00 2026-05-27T23:54:46+00:00

I actually have these tables : – Table games – ID Name – Table

  • 0

I actually have these tables :

- Table games -
ID
Name

- Table ean -
ID
ID_games
EAN

And I have this request :

SELECT games.*, ean.EAN
FROM games
LEFT JOIN ean ON (games.ID = ean.ID_games)

The result will be something like this :

| 1 | Half Life | 358958595 |
| 1 | Half Life | 589584859 |
| 2 | Half Life 2 | 385953684 |
| 2 | Half Life 2 | 585100335 |
etc.

When I do my request and use it in php, it is not useful to have a lot of line with about the same results. I would like to do something like this :

SELECT games.*, ConvertToArray(ean) AS ean_array
FROM games
LEFT JOIN ean ON (games.ID = ean.ID_games)

And have results like this :

| 1 | Half Life | (358958595,589584859) |
| 2 | Half Life 2 | (385953684,585100335 ) |
etc.

Is it possible to that with mysql ? Without an UDF ? And with an UDF ?

Thank you,
Kevin

  • 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-27T23:54:46+00:00Added an answer on May 27, 2026 at 11:54 pm

    Do you object to using GROUP_CONCAT? This would give you a nice delimited list (Assuming the ean value will never have your delimiter within):

    SELECT       games.*, GROUP_CONCAT(ean.EAN) AS ean_list,
    FROM         games
      LEFT JOIN  ean
      ON         games.ID = ean.ID_games
    GROUP BY     games.ID, games.name
    

    Resulting in:

    | 1 | Half Life   | 358958595,589584859 |
    | 2 | Half Life 2 | 385953684,585100335 |
    

    Also, here’s a qeustion I found with this logic applied: mySql – creating a join using a list of comma separated values

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

Sidebar

Related Questions

I have three tables in my DB (actually a few more than that) these
I have a Dataset that contains tables from a university database, two(actually more) of
I have a database that has two tables, these tables look like this codes
I have project which contain 4 tables among these shedule table Session column i
I have three tables like this CREATE TABLE `money`.`categories` ( `ID` bigint(20) unsigned NOT
I am new to ADO.net and have this problem: Let's assume I have these
Lets say we have 3 tables (actually I have 2 at the moment, but
I have a set of tables that's actually a stubby tree. At the top,
SQL 2008 : I have created a View ( select * from VW_Test1 ).
I have two tables TABLE A and TABLE B. TABLE A contain 1 million

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.