Getting Error 1241 (Operand Should contain 1 column(s)

29 Views Asked by At

I believe you all are doing well!

I am trying to execute a nested query in MySQL to retrieve information from two different tables and while executing this getting 1241 error which says "OPERAND SHOULD CONTAIN 1 COLUMN(S)" which I'm unable to understand and perform any correction in my code and due to that seek your assistance in resolve this query.

Here is the code which I'm executing:

SELECT e.emp_no
      ,MIN(de.dept_no) AS dept_code
      ,(SELECT * FROM dept_manager WHERE emp_no = 110022) AS manager_id
  FROM employees e
  JOIN dept_emp de
    ON de.emp_no = e.emp_no
 WHERE e.emp_no <= 110020
 GROUP BY e.emp_no
 ORDER BY e.emp_no;
0

There are 0 best solutions below