您好,登錄后才能下訂單哦!
SQL> SELECT avg(sal) FROM emp;
AVG(SAL)
2135
SQL> SELECT MIN(sal) FROM emp;
MIN(SAL)
800
SQL> SELECT MIN(sal) FROM emp;
MIN(SAL)
800
SQL> SELECT COUNT(*) FROM emp;
COUNT(*)-
15
SQL> select count(distinct deptno) from emp;
COUNT(DISTINCTDEPTNO)
3
SQL> select wm_concat(ename) from emp;
WM_CONCAT(ENAME)
EASON,G_EASON,ALLEN,WARD,JONES,MARTIN,BLAKE,CLARK,SCOTT,KING,TURNER,ADAMS,JAMES,
FORD,MILLER
SQL> SELECT deptno, avg(sal) from emp group by deptno;
DEPTNO AVG(SAL)
30 1566.66667
20 2312.5
10 2916.66667
SQL> SELECT deptno, job, avg(sal) from emp group by deptno, job;
DEPTNO JOB AVG(SAL)
20 CLERK 950
30 SALESMAN 1400
20 MANAGER 2975
30 CLERK 950
10 PRESIDENT 5000
30 MANAGER 2850
10 CLERK 1300
20 ANALYST 3000
10 MANAGER 2450
已選擇9行。
SQL> select avg(sal) from emp group by deptno;
AVG(SAL)
1566.66667
2312.5
2916.66667
SQL> select deptno, WM_concat(ename) from emp group by deptno;
DEPTNO WM_CONCAT(ENAME)
10 CLARK,MILLER,KING
20 EASON,FORD,ADAMS,SCOTT,JONES,G_EASON
30 ALLEN,JAMES,TURNER,BLAKE,MARTIN,WARD
SQL> select deptno,avg(sal) from emp group by deptno having avg(sal) >2500;
DEPTNO AVG(SAL)
10 2916.66667
SQL> select deptno, avg(sal) from emp where deptno=10 group by deptno;
DEPTNO AVG(SAL)
10 2916.66667
SQL> select max(avg(sal)) from emp group by deptno;
MAX(AVG(SAL))
2916.66667
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。