您的当前位置:首页正文

oracle-统计员工x

2023-11-11 来源:帮我找美食网

技术分享

 

1、

SELECTe.depid,avg(s.bonussalary+s.basesalary) AS avgsal from employ e,salary s where e.employId=s.employId GROUP BY e.depidORDER BY avgsal asc

注意顺序 select from where group by oder by

2、

SELECT * from employ e where e.ename like ‘王%‘

oracle-统计员工x

标签:asc   注意   group by   from   ase   员工   rom   acl   alt   

小编还为您整理了以下内容,可能对您也有帮助:

如何用oracle查询出部门名称,部门员工数,部门平均工资,部门最低工资雇员的姓名,及工资等级

这是oracle中默认用户scott下的表。

本问题涉及到三张表,数据分别如下:

emp表:

dept表:

salgrade表:

按题目要求,sql语句如下:

select b.dname 部门名称,b.counts 部门员工数,b.avgsal 部门平均工资,b.minsal 部门最低工资,a.ename 姓名,c.grade 工资等级

from emp a,

(select b.deptno,b.dname,count(*) counts,round(avg(sal),2) avgsal,min(sal) minsal

from emp a,dept b,salgrade c

where a.deptno=b.deptno and a.deptno=b.deptno

and a.sal between c.losal and hisal

group by  b.deptno,b.dname) b,

salgrade c

where a.sal=b.minsal

and a.sal between c.losal and c.hisal

结果如图:

在oracle数据库中,员工考勤统计怎么写sql语

考勤信息表

tbl_manualsign

(

ms_id

user_id

ms_time

ms_desc

ms_tag

)

光靠这一个表,不能确定你需要的信息啊。

比如迟到次数,早退次数,还需要知道上下班的时间啊(是固定的值吗)

旷工次数,需要知道哪此是工作日啊(也是固定值,还是按常规算)

再有,每个人上班打一次卡,下班打一次卡(即每人每在在这个表中有2条记录罢)

这些都需要进一步确定。

oracle 统计同一天入职的员工有多少人?

技术分享

 

1、

SELECT
e.depid,avg(s.bonussalary+s.basesalary) AS avgsal from employ e,salary s
where e.employId=s.employId GROUP BY e.depid
ORDER BY avgsal asc

注意顺序 select from where group by oder by

2、

SELECT * from employ e where e.ename like ‘王%‘

oracle-统计员工x

标签:asc   注意   group by   from   ase   员工   rom   acl   alt   

oracle 统计同一天入职的员工有多少人?

技术分享

 

1、

SELECT
e.depid,avg(s.bonussalary+s.basesalary) AS avgsal from employ e,salary s
where e.employId=s.employId GROUP BY e.depid
ORDER BY avgsal asc

注意顺序 select from where group by oder by

2、

SELECT * from employ e where e.ename like ‘王%‘

oracle-统计员工x

标签:asc   注意   group by   from   ase   员工   rom   acl   alt   

oracle sql 以部门统计每个员工入职的部门和每个月工资

技术分享

 

1、

SELECT
e.depid,avg(s.bonussalary+s.basesalary) AS avgsal from employ e,salary s
where e.employId=s.employId GROUP BY e.depid
ORDER BY avgsal asc

注意顺序 select from where group by oder by

2、

SELECT * from employ e where e.ename like ‘王%‘

oracle-统计员工x

标签:asc   注意   group by   from   ase   员工   rom   acl   alt   

oracle sql 以部门统计每个员工入职的部门和每个月工资

技术分享

 

1、

SELECT
e.depid,avg(s.bonussalary+s.basesalary) AS avgsal from employ e,salary s
where e.employId=s.employId GROUP BY e.depid
ORDER BY avgsal asc

注意顺序 select from where group by oder by

2、

SELECT * from employ e where e.ename like ‘王%‘

oracle-统计员工x

标签:asc   注意   group by   from   ase   员工   rom   acl   alt   

求一条oracle查询(统计)语句

SELECT
员工的编号,MAX(打卡时间)
FROM
员工打卡记录表
GROUP
BY
员工的编号;
这样能获取该员工最后一次打卡时间,如果还要其他信息,语句可扩展

求一条oracle查询(统计)语句

SELECT
员工的编号,MAX(打卡时间)
FROM
员工打卡记录表
GROUP
BY
员工的编号;
这样能获取该员工最后一次打卡时间,如果还要其他信息,语句可扩展

oracle中统计每个部门下的人数怎么写

SELECT D.DEPTNO, D.DNAME, COUNT(E.EMPNO) FROM SCOTT.EMP E, SCOTT.DEPT D WHERE E.DEPTNO = D.DEPTNO GROUP BY cube(D.DEPTNO, D.DNAME)

Oracle 语句,查询出scott用户下的每个部门的员工数,要求没有员工的部门,列出0

select a.dname,

sum(case when a.deptno=b.deptno then 1 else 0 end) 人数

from dept a left join emp b on a.deptno=b.deptno

group by a.dname

Top