登录 注册
当前位置:主页 > 资源下载 > 在SQL语言基础中,涉及子查询时使用分组函数的场景

在SQL语言基础中,涉及子查询时使用分组函数的场景

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

资源介绍

在子查询中使用分组函数 * ENAME JOB SAL ---------- --------- --------- SMITH CLERK 800 SQL> SELECT ename, job, sal 2 FROM emp 3 WHERE sal = 4 (SELECT MIN(sal) 5 FROM emp); 800 * SELECT ename, job, sal FROM emp WHERE sal = (SELECT MIN(sal) FROM emp); Using Group Functions in a Subquery You can display data from a main query by using a group function in a subquery to return a single row. The subquery is in parentheses and is placed after the comparison operator. The example on the slide displays the employee name, job title, and salary of all employees whose salary is equal to the minimum salary. The MIN group function returns a single value (800) to the outer query.