emp表和dept表 Oracle删除表中重复记录方法是什么?
Oracle删除表中重复记录方法是什么?delete from dept where rowid not in (select min(rowid) from dept group by deptno
Oracle删除表中重复记录方法是什么?
delete from dept where rowid not in (select min(rowid) from dept group by deptno , dname ,loc)这样可以保证所有的重复数据仅保留一条,其余的删除
oracle中emp、dept、salgrade、bonus以及其中对应每个字段分别是什么意思?
EMP可以是表名,或是字段名,dept是部门,salgrade是工资bonus是奖金
oracle 11g默认数据库里面,有张emp表,其中有字段ename、deptno、sal分别对应雇员名、部门编号和月薪?
select deptno,max(sal) from emp group by deptno
这条语句可以得出每个部门的最高工资,可以在这条语句的基础上和emp表关联,得出月薪最高的雇员;
例如:
select a.ename,a.deptno,a.sal from emp a,(select deptno,max(sal) m_sal from emp group by deptno) b where a.deptno=b.deptno and a.sal=b.m_sql
除此以外可以是通过分析函数获得部门最高月薪员工
例如:
select ename,deptno,sal,rank() over(partition by deptno order by sal desc) from emp