select count(*) from emp where sal > (select sal from emp where depart=Mydepart )
试试看,退出数据库使用好久了
SELECT COUNT(*)
FROM employees a
WHERE a.salary-500>(SELECT salary FROM employees WHERE employees.employee_id=&a);
---由于不知道你当前员工的ID是多少,所以用了变量a
工资比我当前员工高出500以外: a.salary-500>(...) 这个要注意
SELECT COUNT(*)
FROM employees a
WHERE a.salary>(SELECT salary FROM employees WHERE employees.employee_id=&a);
---由于不知道你当前员工的ID是多少,所以用了变量a
select count(*) from emp where sal > (select sal from emp where depart=Mydepart )