SQL查询给出操作数应包含1列

时间:2019-04-21 13:37:27

标签: mysql join mysqli left-join database-engine

我正在学习SQL连接。但是,我正在运行以下查询,并出现一个错误,提示operand should contain 1 column(s)

下面是查询

SELECT departments.department_name, designations.designation_name, cities.city_name, employees.emp_id, employees.name FROM employees LEFT JOIN cities ON (employees.city_id = cities.id) LEFT JOIN designations ON (employees.designation_id = designations.id) LEFT JOIN departments ON (designations.department_id = departments.id) WHERE employees.status = 1 AND employees.designation_id IN (SELECT designations.department_id, employees.designation_id FROM employees LEFT JOIN designations ON (employees.designation_id = designations.id) LEFT JOIN departments ON (designations.department_id = 3)) AND employees.city_id IN (SELECT employees.city_id FROM employees) AND employees.grade_id IN (SELECT employees.grade_id FROM employees) ORDER BY employees.name DESC

我无法弄清楚这里出了什么问题!

有人可以帮我吗?

0 个答案:

没有答案