登录 注册
当前位置:主页 > 资源下载 > 在SQL语言基础中,涉及运用ALL操作符于子查询之中

在SQL语言基础中,涉及运用ALL操作符于子查询之中

  • 更新:2024-07-07 12:07:38
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

在子查询中使用ALL操作符 * EMPNO ENAME JOB --------- ---------- --------- 7839 KING PRESIDENT 7566 JONES MANAGER 7902 FORD ANALYST 7788 SCOTT ANALYST SQL> SELECT empno, ename, job 2 FROM emp 3 WHERE sal > ALL 4 (SELECT avg(sal) 5 FROM emp 6 GROUP BY deptno); 2916.6667 2175 1566.6667 * SELECT empno, ename, job FROM emp WHERE sal > ALL (SELECT avg(sal) FROM emp GROUP BY deptno); Multiple-Row Subqueries (continued) The ALL operator compares a value to every value returned by a subquery. The slide example displays employees whose salary is greater than the average salaries of all the departments. The highest average salary of a department is $2916.66, so the query returns those employees whose salary is greater than $2916.66. >ALL means more than the maximum and