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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:45:55+00:00 2026-05-23T07:45:55+00:00

SELECT A.id, A.title, FROM (`table`) as A WHERE A.active = ‘1’ AND A.id IN

  • 0
SELECT  A.id, A.title, 
FROM (`table`) as A
WHERE A.active = '1'
AND A.id IN (SELECT GROUP_CONCAT(B.id) from B where user = 3)

If i launch subquery SELECT GROUP_CONCAT(B.id) from B where user = 3 only, i obtain 1,2,3,4. But if i launch entire query i obtain only one row.

But if i try to substitute the subquery with its value (1,2,3,4)

SELECT  A.id, A.title, 
FROM (`table`) as A
WHERE A.active = '1'
AND A.id IN (1,2,3,4)

i obtain the 4 rows … as i need.

Where is my error ?

  • 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-23T07:45:55+00:00Added an answer on May 23, 2026 at 7:45 am

    MySQL is seeing the subquery return only a single field/row, and therefore treats it as something like:

    ... and A.id IN ('1,2,3,4')
    

    which boils down to A.id = '1,2,3,4'.

    For an ‘in’ query, there’s no need for the group_concat stuff, simply do:

    ... and A.id IN (select B.id FROM b where user = 3)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using sqlite3, if my query is SELECT * FROM table WHERE title LIKE '%x%'
I have building MYSQL queries with backticks. For example, SELECT `title` FROM `table` WHERE
I have 2 tables: User(Id PK, TitleId FK, Name, Active) Title(Id PK, Text) Table
I have the following statement: SELECT title, price FROM table WHERE id=? Should I
mysql> select count(*) from table where relation_title='xxxxxxxxx'; +----------+ | count(*) | +----------+ | 1291958
SELECT events.title FROM events ORDER BY events.title DESC I'm getting the proper ordering for
and get meaningful results. Currently I am running these three queries: SELECT t.type,t.id,s.title FROM
SQL query: SELECT ArticleCategories.Title AS Category, Articles.Title, Articles.[Content], Articles.Date FROM ArticleCategories INNER JOIN Articles
The original query looks like this (MySQL): SELECT * FROM books WHERE title LIKE
SELECT PLD_LINK.ID, PLD_LINK.TITLE, PLD_LINK.URL, PLD_CATEGORY.TITLE, TLL_SORT_STATUS.status, PLD_LINK_COMMENT.DATE_ADDED FROM PLD_LINK, PLD_CATEGORY, TLL_SORT_STATUS, PLD_LINK_COMMENT WHERE PLD_LINK.CATEGORY_ID

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.