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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:53:17+00:00 2026-05-20T19:53:17+00:00

The following query is working for me and returns the data in the format

  • 0

The following query is working for me and returns the data in the format ‘1755|1755.jpg’ :

SELECT (CAST(GROUP_CONCAT(CONCAT(photoId, '|', photoFileName)) AS CHAR(10000) CHARACTER SET utf8)) AS recentPhotoList
                              FROM
                              (
                                SELECT photoId, photoFileName
                                FROM photo
                                WHERE photoAlbumId = _albumId
                                AND photoPublishDate >= DATE_ADD(tStartDate, INTERVAL -20 MINUTE)
                                AND photoPublishDate <= tStartDate
                                ORDER BY photoPublishDate DESC
                                LIMIT 0,1
                              ) as subQuery
                            );

However, by simply appending another column (‘photoCaption’) to the query, it then returns nothing?!? Why is this? Why is adding an additional column causing it to do this?

Here is the modified query that causes issues:

SELECT (CAST(GROUP_CONCAT(CONCAT(photoId, '|', photoFileName, '|', photoCaption)) AS CHAR(10000) CHARACTER SET utf8)) AS recentPhotoList
                              FROM
                              (
                                SELECT photoId, photoFileName, photoCaption
                                FROM photo
                                WHERE photoAlbumId = _albumId
                                AND photoPublishDate >= DATE_ADD(tStartDate, INTERVAL -20 MINUTE)
                                AND photoPublishDate <= tStartDate
                                ORDER BY photoPublishDate DESC
                                LIMIT 0,1
                              ) as subQuery
                            );
  • 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-20T19:53:18+00:00Added an answer on May 20, 2026 at 7:53 pm

    I think that if photoCaption is null then the concat returns null. Use coalesce around photoCaption to solve this.

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

Sidebar

Related Questions

The following query returns strange results for me: SELECT `Statistics`.`StatisticID`, COUNT(`Votes`.`StatisticID`) AS `Score`, COUNT(`Views`.`StatisticID`)
I have the following query which is working fine, but I also want to
I have the following query and it is working fine. If you see the
Order by descending is not working on LINQ to Entity In the following Query
I'm working on the following LINQ query: public void GetAuditRuleAgencyRecords(IEnumerable<Entities.AuditRule> rules) { using (LinqModelDataContext
I have the following xpath query which seems to be working but I just
The following query returns the total amount of orders, per week, for the past
The following query: SELECT DISTINCT ClassName FROM SiteTree ORDER BY ClassName is returning things
Working SQL The following code works as expected, returning two columns of data (a
I have to write a query to get the following data as result. I

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.