1

I have a complex MySQL problem.

SELECT *
FROM banners, content_id_country, languages
    WHERE content_id_country.content_id = banners.id
        AND content_id_country.controller = 'banners'

Gives me a long result back. The result is perfect, there is only one problem.

Some rows are duplicates, so they have only one field changed.

The result will look like:

1 - Title - Text - NL
1 - Title - Text - EN

When I use a "GROUP BY banners.id" one of the two disappears. That is particaly what I am achieving.

The result I would like to get looks like this: 1 - Title - Text - NL, EN

So basically I would like to merge the row, and add a comma.

I hope that this is possible.

innaM
  • 46,966
  • 4
  • 66
  • 87
Henk Denneboom
  • 1,605
  • 3
  • 15
  • 17

1 Answers1

5

See this question:

Can I concatenate multiple MySQL rows into one field?

Community
  • 1
  • 1
Welbog
  • 57,620
  • 8
  • 112
  • 120