在子查询中使用分组函数-SQL语言基础

时间:2024-05-15 13:25:01
【文件属性】:

文件名称:在子查询中使用分组函数-SQL语言基础

文件大小:5.26MB

文件格式:PPT

更新时间:2024-05-15 13:25:01

SQL 基础

在子查询中使用分组函数 * 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.


网友评论