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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:06:10+00:00 2026-05-15T22:06:10+00:00

See the tables structure here. I have this sql: SELECT `feed_entries` . * FROM

  • 0

See the tables structure here.

I have this sql:

SELECT `feed_entries` . *
FROM `feed_entries`
WHERE 
id
IN (

SELECT `e`.`id`
FROM `feed_entries` AS `e`
INNER JOIN `feeds` AS `f` ON e.feed_id = f.id
INNER JOIN `entries_categorias` AS `ec` ON ec.entry_id = e.id
INNER JOIN `categorias` AS `c` ON ec.categoria_id = c.id
WHERE 
  e.deleted =0
AND 
  c.slug
  IN ('manchete', 'google')
GROUP BY `e`.`id`
HAVING COUNT( DISTINCT ec.id ) =2

)

ORDER BY `date` DESC
LIMIT 1 

And I want to add these fields:

`f`.`titulo` AS `feedTitulo` , `f`.`url` AS `feedUrl`

How can I do that? Without get this error:

#1241 - Operand should contain 1 column(s) 
  • 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-15T22:06:10+00:00Added an answer on May 15, 2026 at 10:06 pm

    This should work:

    SELECT e1.*, f1.titulo AS feedTitulo, f1.url AS feedUrl
      FROM feed_entries AS e1 JOIN feeds AS f1 ON e1.feed_id = f1.id
     WHERE f1.id IN
                (SELECT e.id
                   FROM feed_entries            AS e
                  INNER JOIN feeds              AS f  ON e.feed_id = f.id
                  INNER JOIN entries_categorias AS ec ON ec.entry_id = e.id
                  INNER JOIN categorias         AS c  ON ec.categoria_id = c.id
                  WHERE e.deleted = 0
                    AND c.slug IN ('manchete', 'google')
                  GROUP BY e.id
                 HAVING COUNT(DISTINCT ec.id) = 2
                )
     ORDER BY `date` DESC
     LIMIT 1
    

    I removed most of the back-ticks because they look very peculiar to me – but I don’t use MySQL.

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

Sidebar

Related Questions

I have a table. see my table structure <table width=100% border=1> <tr> <td width=2%><h2>#
I have a couple of questions. 1) Why cannot we see system tables (like
I want to compare fields in 2 tables to see if the fields have
Here is simplified SQL of my tables, which is converted to LINQ to SQL
This is a follow up of another question here on SO . I have
I have a table in my database which stores a tree structure. Here are
I have to join 2 tables which are currently holding more than 200K data
I have currently created a facebook like page that pulls notifications from different tables,
Ok so i have a database table called requests with this structure mysql> desc
I have 3 database tables like rooms , room_type and room_status . Here is

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.