Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 如何找到员工总数为#x27;在SQL中,您的工资是否大于或等于10000?_Mysql_Sql - Fatal编程技术网

Mysql 如何找到员工总数为#x27;在SQL中,您的工资是否大于或等于10000?

Mysql 如何找到员工总数为#x27;在SQL中,您的工资是否大于或等于10000?,mysql,sql,Mysql,Sql,下面是该表的屏幕截图和我对该查询的尝试 这是我正在运行的查询 SELECT department FROM employees where ( select sum(salary) group by department having sum(salary) >=10000); 它返回0行,而它应该返回'COE',因为它的雇员总数是14000我想你只需要这样: select department from empl

下面是该表的屏幕截图和我对该查询的尝试

这是我正在运行的查询

SELECT department 
  FROM employees 
 where ( select sum(salary) 
            group 
        by department 
        having sum(salary) >=10000);

它返回0行,而它应该返回'COE',因为它的雇员总数是14000

我想你只需要这样:

select department
from employees
group by department
having sum(salary) >= 10000;

我想你只是想要这个:

select department
from employees
group by department
having sum(salary) >= 10000;