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

  • Home
  • SEARCH
  • 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 554219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:41:12+00:00 2026-05-13T11:41:12+00:00

i tried now nearly everything i could to solve he following problem. So far

  • 0

i tried now nearly everything i could to solve he following problem. So far with no success. But there must be a solution cause i dont think the case is s.th too special. I think i am just a bloody beginner 😉 I need to join union merge or whatever 😉 in MySQL to solve the following problem…

CASE: Three tables “posts”, “tagmap” and “tags”

The tagmap table stores all n-m relations the id’s of the posts and the id’s of the tags
The tags table stores the tag_name with the tag id
The posts table stores the post_title and the post_id

 posts    post_id    post_title
          1          Charlie Chaplin Painting

 tagmap   id         post_id    tag_id
          100        1          12
          101        1          13
          102        1          14

 tags     tag_id     tag_name
          12         Acryl
          13         Chalk
          14         Poster

What i am trying to achieve is to get a result as the follwing where all related tags are merged in one column. Either by a comma separated list or spaces:
post_id => 1, post_title => Charlie Chaplin… tag_name => Acryl, Chalk, Poster

But till now the only thing i could get are mukltiple results like this:
post_id => 1, post_title => Charlie Chaplin… tag_name => Acryl
post_id => 1, post_title => Charlie Chaplin… tag_name => Chalk
post_id => 1, post_title => Charlie Chaplin… tag_name => Poster

Does anyone know how this could be achieved… Any help would be highly appreciated and thx in advance to everyone who could help me out whith this 😉

  • 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-13T11:41:13+00:00Added an answer on May 13, 2026 at 11:41 am

    Use:

      SELECT p.post_id,
             p.post_title,
             GROUP_CONCAT(t.tag_name ORDER BY t.tag_name SEPARATOR ', ')
        FROM POSTS p
        JOIN TAGMAP tm ON tm.post_id = p.post_id
        JOIN TAGS t ON t.tag_id = tm.tag_id
    GROUP BY p.post_id, p.post_title
    

    Reference:

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

Sidebar

Related Questions

I have a data with the following format: foo<tab>1.00<space>1.33<space>2.00<tab>3 Now I tried to sort
I tried the following DateTime start = Convert.ToDateTime(TextBox1.Text); DateTime end = Convert.ToDateTime(TextBox2.Text); if (DateTime.Now.Date
I'll point out now, that I'm new to using saxon, and I've tried following
I've tried in 1 hour now, trying to find out how I could extract
I got nearly no knowledge of haskell and tried to solve some Project Euler
I know, there are several posts with nearly the same question, but all the
I have now tried to get this to work for a few hours but
So i think ive tried everything now. Im trying to get the values from
Ive tried searching for hours now and cannot find out why my code (aka,
I have tried for three days now and gotten nowhere on this.... I absolutely

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.