--建立测试环境 Create Table 表(部门 varchar(5),人数 integer,实出勤天数 float,平常加班 float) --插入数据 insert into 表 select 'C1','1','4.00','6.00' union select 'C1','3','8.00','3.00' union select 'C1','6','8.00','6.00' union select 'C1','1','8.00','6.00' union select 'C1','1','8.00','9.00' union select 'C1','1','17.00','24.00' union select 'C1','1','17.00','36.00' union select 'C1','2','22.00','16.00' union select 'C1','1','22.00','44.00' select * from 表 compute sum(人数),sum(实出勤天数),sum(平常加班)--测试语句
Create Table 表(部门 varchar(5),人数 integer,实出勤天数 float,平常加班 float)
--插入数据
insert into 表
select 'C1','1','4.00','6.00' union
select 'C1','3','8.00','3.00' union
select 'C1','6','8.00','6.00' union
select 'C1','1','8.00','6.00' union
select 'C1','1','8.00','9.00' union
select 'C1','1','17.00','24.00' union
select 'C1','1','17.00','36.00' union
select 'C1','2','22.00','16.00' union
select 'C1','1','22.00','44.00'
select * from 表 compute sum(人数),sum(实出勤天数),sum(平常加班)--测试语句
--删除测试环境
Drop Table 表