7788 SCOTT ANALYST 09-DEC-82 3000 20 7876 ADAMS CLERK 12-JAN-83 1100 20 7934 MILLER CLERK 23-JAN-82 1300 10 当emp的工资是>时,b $ bi需要详细信息平均工资 我尝试过: select * from emp group by sal 有sal> avg(sal);7839KING PRESIDENT17-NOV-815000107698BLAKE MANAGER 01-MAY-812850307782CLARK MANAGER 09-JUN-812450107566JONES MANAGER 02-APR-812975207654MARTIN SALESMAN 28-SEP-8112501400307499ALLEN SALESMAN 20-FEB-811600300307844TURNER SALESMAN 08-SEP-8115000307900JAMES CLERK 03-DEC-81950307521WARD SALESMAN 22-FEB-811250500307902FORD ANALYST 03-DEC-813000207369SMITH CLERK 17-DEC-80800207788SCOTT ANALYST 09-DEC-823000207876ADAMS CLERK 12-JAN-831100207934MILLER CLERK 23-JAN-82130010i want details when salary of emp is > average of salaryWhat I have tried:select * from emp group by salhaving sal>avg(sal);推荐答案我可以通过使用子查询解决这个问题 select * from emp where sal> =(从emp中选择avg(sal));i can solve this by using subqueryselect * from emp where sal>=(select avg(sal) from emp); 这篇关于如何在oracle 10g的where子句中使用聚合函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-14 05:57