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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:44:34+00:00 2026-05-25T02:44:34+00:00

Right now the below query returns 1 row for each result…. I need to

  • 0

Right now the below query returns 1 row for each result…. I need to show a list of tags for each row and I’m debating whether to change this query so it INNER JOINS the tags and parsing out the data on the PHP end, or if I should just run a separate query for each return result…. what are your thoughts on this? Should I pull the extra data and parse it on the PHP end or run additional queries (maybe 25-30)?

            SELECT
                content.id,
                content_text.content
            FROM content
            INNER JOIN content_text ON (
                content_text.content_id = content.id AND
                content_text.language_id = 1
            )
            INNER JOIN tags_to_content ON (
                tags_to_content.tag_id IN (1)
            )
  • 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-25T02:44:34+00:00Added an answer on May 25, 2026 at 2:44 am

    You could rely on a small command that is not used much in mysql : GROUP_CONCAT().

    Official Doc for GROUP_CONCAT

    Here is a small example (not based on your current question since I don’t know the specifics, its a example that could apply to a blog):

    SELECT
      p.title as title,
      p.content as content,
      GROUP_CONCAT(c.name order by c.name SEPARATOR ', ') as categories
    FROM
      post as p
    INNER JOIN
      post_category as pc
    ON
      p.id = pc.post_id
    INNER JOIN
      category as c
    ON
      pc.category_id = c.id
    GROUP BY
      p.id
    

    Which would return

    +------------------+--------------------+------------------------------------+
    | title            | content            | categories                         |
    +------------------+--------------------+------------------------------------+
    | Some title       | Some content       | category 1, category 2, category 3 |
    | Some other title | Some other content | category 1, category 3, category 4 |
    ...
    +------------------+--------------------+------------------------------------+
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now I'm sorting by each articles auto_increment id with the query below mysql_query("SELECT
below is my xml document and right now my query is: /description/*/text() , I
Right now, I'm particularly interested in reading the data from MP3 files (ID3 tags?),
I want to write an efficient query which returns a list of fruits by
How to upload an image on the internet? right now the script below works
Below is the code I'm using to run the query, parse the result set,
My application has a requirement that we need to encrypt index fields. Right now
Right now I have only one condition in my Projects.paginate Code is below def
Right now, I keep all of my projects on my laptop. I'm thinking that
Right now my ant task looks like. <javadoc sourcepath=${source} destdir=${doc}> <link href=http://java.sun.com/j2se/1.5.0/docs/api/ /> </javadoc>

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.