我收到此错误消息"在预期的地方找不到FROM关键字。"我做错了什么?
SELECT department_id
FROM employees
HAVING MIN(salary) < (SELECT MIN(salary)
WHERE department_id < 60)
GROUP BY department_id;
感谢您的帮助!
答案 0 :(得分:1)
你错过了一行:
SELECT MIN(salary)
WHERE department_id < 60
需要
SELECT MIN(salary) FROM {TABLENAMEHERE}
WHERE department_id < 60
完整查询:
SELECT department_id
FROM employees
GROUP BY department_id
HAVING MIN(salary) < (SELECT MIN(salary) FROM {TABLENAMEHERE}
WHERE department_id < 60);