oracle数据库系统表emp的查询:求出工资比我当前员工高出500以外的人员个数。

2025-03-23 03:16:17
推荐回答(4个)
回答1:

select count(*) from emp where sal > (select sal from emp where depart=Mydepart )
试试看,退出数据库使用好久了

回答2:

SELECT COUNT(*)
FROM employees a
WHERE a.salary-500>(SELECT salary FROM employees WHERE employees.employee_id=&a);
---由于不知道你当前员工的ID是多少,所以用了变量a
工资比我当前员工高出500以外: a.salary-500>(...) 这个要注意

回答3:

SELECT COUNT(*)
FROM employees a
WHERE a.salary>(SELECT salary FROM employees WHERE employees.employee_id=&a);
---由于不知道你当前员工的ID是多少,所以用了变量a

回答4:

select count(*) from emp where sal > (select sal from emp where depart=Mydepart )