2022-10-31
閱讀量:
426
mysql學習12-having分組后篩選
-- 23 分組后篩選
-- 查詢各部門clerk的平均工資
select deptno 部門編號,job 職位, avg(sal) 平均工資
from emp
group by deptno
having job= "clerk"
order by deptno;
-- 查詢平均工資大于2000的部門
select deptno ,avg(sal)
from emp
group by deptno
having avg(sal) >2000;






評論(0)


暫無數(shù)據(jù)
推薦帖子
0條評論
1條評論
0條評論