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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:11:03+00:00 2026-05-30T15:11:03+00:00

I have a problem incorporating a Group_Concat function in my SQL query. I have

  • 0

I have a problem incorporating a Group_Concat function in my SQL query. I have tried to work around it with PHP, but I would prefer to get it right with SQL instead. My code is below, I am using the latest version of MYSQL.

SELECT Main.Title, Main.DatePrint, Main.PerformanceDate, Main.Unsure_Sure, Main.Register, Main.notes, 
VenueKey.Venue,AuthorKey.Author, CompanyKey.Company, PrintKey.Printer, SourceKey.Source 
FROM Main INNER JOIN MainVenue
    ON Main.MainID = MainVenue.ID_V
    INNER JOIN VenueKey
    ON MainVenue.VenueID = VenueKey.ID_V_K

    INNER JOIN MainAuthor
    ON Main.MainID = MainAuthor.ID_A
    INNER JOIN AuthorKey
    ON MainAuthor.AuthorID = AuthorKey.ID_A_K

    INNER JOIN MainCompany
    ON Main.MainID = MainCompany.ID_C
    INNER JOIN CompanyKey
    ON MainCompany.CompanyID = CompanyKey.ID_C_K

    INNER JOIN MainPrinter
    ON Main.MainID = MainPrinter.ID_P
    INNER JOIN PrintKey
    ON MainPrinter.PrinterID = PrintKey.ID_P_K

    INNER JOIN MainSource
    ON Main.MainID = MainSource.ID_S
    INNER JOIN SourceKey
    ON MainSource.SourceID = SourceKey.ID_S_K

Ideally I would like to use a Group_Concat on Author, Venue, and Company but I have been having a hard time getting it to work, with it instead returning a null value. Please let me know what if there is anything I can do to fix this.

Thanks.

  • 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-30T15:11:05+00:00Added an answer on May 30, 2026 at 3:11 pm

    You must be grouping the results in order for GROUP_CONCAT to have something to work with. Try something along the lines of:

    SELECT
      AuthorKey.Author,
      GROUP_CONCAT(VenueKey.Venue) AS all_venues,
      GROUP_CONCAT(CompanyKey.Company) AS all_companies
    ...
    GROUP BY AuthorKey.Author
    

    to get a list of the authors with a concatenated list of venues and companies for example.

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

Sidebar

Related Questions

I have problem with fancybox. I want to write a function that will run
I have problem with code. I have written a function for extracting a parameter,
i have problem with jquery submit and post. I would like to submit a
I have problem in my split Sentence function . The idea of ​​my function
I have problem with passing variables through views. But, first some code // i
I have problem to make work a resource file. This is my simple code
i have problem in javascript email validation, I wrote code something like, //emp.php <form
I have problem understanding this one: <?php $string = 'April 15, 2003'; $pattern =
I have problem in some JavaScript that I am writing where the Switch statement
I have problem with return statment >.< I want to store all magazine names

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.