问题:查找数据库中收入超过“小银行公司”每位员工的所有员工的姓名。假设所有人最多只为一家公司工作。
我尝试了这个SQL命令
SELECT employee-name, salary
FROM works
WHERE salary>salary.works(SELECT company-name="Small Bank Corporation");
当然命令不起作用所以我在这个问题上需要帮助,非常感谢帮助。
答案 0 :(得分:1)
SELECT
employee-name
FROM works
WHERE salary > (SELECT
MAX(salary)
FROM works
WHERE company-name = 'Small Bank Corporation');
答案 1 :(得分:0)
您的查询几乎正确无误:
SELECT
[employee-name]
,[salary]
FROM works
WHERE salary > (SELECT MAX(salary) FROM works WHERE [company-name] = 'Small Bank Corporation')