2022-01-21
阅读量:
331
-- 数学函数
select abs(-32);
select floor(1.83);
select floor(-1.83);
select ceiling(1.23);
select ceiling(-1.23);
select round(1.58);
select round(1.58,1);
-- 练习:查询各部门员工人数占比(四舍五入并保留两位小数)
select
deptno,
count(*) as 各部门员工人数,
round(count(*)/(select count(*) from emp),2) as 人数占比
from emp
group by deptno;






评论(0)


暂无数据