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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:30:06+00:00 2026-06-15T17:30:06+00:00

SELECT topic_id FROM phpbb_topics AS t WHERE t.topic_id IN ( SELECT p.topic_id, COUNT(p.post_id) AS

  • 0
SELECT topic_id
FROM phpbb_topics AS t
WHERE t.topic_id IN (
    SELECT p.topic_id, COUNT(p.post_id) AS total_posts
    FROM phpbb_posts AS p
    WHERE p.poster_id = 61640
    GROUP BY p.topic_id
    HAVING t.topic_replies_real = total_posts - 1
);

That query gets me the following error:

Error Code: 1241. Operand should contain 1 column(s)

Any ideas?

  • 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-15T17:30:06+00:00Added an answer on June 15, 2026 at 5:30 pm

    You shouldn’t include COUNT(p.post_id) AS total_posts in SELECT list in your subquery.
    Just

    SELECT topic_id   
    FROM phpbb_topics AS t
    WHERE t.topic_id IN (
        SELECT p.topic_id --, COUNT(p.post_id) AS total_posts 
        FROM phpbb_posts AS p
        WHERE p.poster_id = 61640
        GROUP BY p.topic_id
        HAVING t.topic_replies_real = COUNT(p.post_id) - 1
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this MySQL query that I'd like to optimize: SELECT min(`topic_id`) FROM `gallery_topics`
Im having this query: $query = $db->query(SELECT posts.post_topic_id, posts.post_content, posts.post_id, posts.post_date, posts.post_by, posts.post_votes_total, posts.post_suggested_amount,
I have a nested SQL query : SELECT DISTINCT(topic_id) FROM bb_posts WHERE topic_id NOT
<?php function check($user_id, $topic_id){ $query = mysql_query(SELECT user_id, topic_id FROM sa where topic_id='$topic_id' and
TOPIC_COUNT_SQL = SELECT COUNT(*) FROM topics_topic WHERE topics_topic.object_id = maps_map.id AND topics_topic.content_type_id = %s
topic.php $id = isset($_GET['id']) ? intval($_GET['id']) : 0; $query = mysql_query(SELECT * FROM topics
I have the following query SELECT e.topicShortName, d.catalogFileID, e.topicID FROM catalog_topics a LEFT JOIN
$sql = sprintf( SELECT topic_title FROM `phpbb_topics` WHERE `topic_title` LIKE '%%%s%%' LIMIT 20 ,
Which query would run faster? SELECT * FROM topic_info LEFT JOIN topic_data ON topic_info.id
I currently have this query set-up: SELECT topic.content_id, topic.title, image.location FROM mps_contents AS topic

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.