1241 🐬 MySQL

MySQL ERROR 1241 (21000): Operand should contain 1 column(s)

A subquery or expression returned several columns where only one is expected.

Seen on: MySQL

Meaning

Using SELECT a, b in an IN (...) or comparison, or extra parentheses turning a list into a row constructor.

Common causes

  • Subquery selecting multiple columns in IN/=
  • Parenthesised column list in SELECT

⚡ Quick fix

  1. Select a single column in the subquery
  2. Use row comparisons deliberately: (a, b) IN (SELECT a, b …)

Detailed fix by platform

MySQL

  1. SELECT * FROM orders WHERE user_id IN (SELECT id FROM users WHERE active = 1);

How to diagnose

  1. Subquery — How many columns?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.