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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:11:02+00:00 2026-06-12T16:11:02+00:00

suppose an object can have multiple tids now suppose I do this query: SELECT

  • 0

suppose an object can have multiple tids

now suppose I do this query:

SELECT n.nid, t.tid, GROUP_CONCAT(t.tid) 
FROM node n JOIN term_node t ON t.nid = n.nid 
GROUP BY n.nid 
HAVING t.tid = 31;

In which I want to fetch entries in table node that has tid = 31…but then I also want a list of all the tids corresponding to that row (hence the GROUP_CONCAT) even if they are not 31

Using WHERE t.tid = 31 will leave out the tids that are not 31 from the GROUP concat
and using HAVING t.tid = 31 will leave out rows in which the tid column that appears in the GROUPed row is not 31

Either way has the potential to make the GROUP_CONCAT list incomplete or the rows of nodes with at least one tid = 31 incomplete

Is there a way to resolve this such that I am guaranteed to get ALL the nodes in which the node has at least one tid association equals to 31 AND that GROUP_CONCAT will list ALL The list of tids associated with that node?

  • 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-06-12T16:11:04+00:00Added an answer on June 12, 2026 at 4:11 pm

    This would probably be better as 2 queries. GROUP_CONCAT has a limitation on how long the resulting string can be anyways, so it is not reliable unless you know you will always be under the string length limit.

    I would run the first query ‘WHERE tid = 31’, then run a separate query to get all other ids afterwards and combine in code.

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

Sidebar

Related Questions

Possible Duplicate: Pick random property from a Javascript object suppose I have a javascript
can it make sense for one table to have multiple foreign keys? Suppose I
Suppose you have a few, quite large (100k+) objects in available and can provide
Suppose an object travels in a parabola in 2D coordinate system from P to
suppose I have a object: obj:{ child:{ x:12, y:50 }, key1:value1, key2:value2 } if
Suppose i have a json object friends as: { title: Friends link: /friends.json description:
Suppose I have a customer object that has all of the standard customer properties
Suppose I have an entity object defined as public partial class Article { public
I have an object can be compose by components but each components has a
I need to develop a client server system where I can have multiple clients

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.