OracleSQL

select * from emp where sal in(select min(sal) from emp group by deptno)//查询每个部门中最低工资的员工信息


//查询出:部门名称、部门员工数、部门的平均工资、部门的最低收入雇主的姓名:程序要关联两张表 dept/emp
select d.deptname,ed.c,ed,a from dept d,(select deptno,count(empno) c,avg(sal) a from emp group by deptno) ed where d.deptno=ed.deptno
 
create table aa as select * from emp//表复制  如果不需要数据,只需要写一个永远不可能成立的条件即可


delete from emp where empname is  not null//删除部门名称不为空的员工信息



select  c1.courcename c11,c2.courcename c22 from cource c1,cource c2 where c1.courcename <>c2.courcename order by c1.courcename desc//自己关联自己,产生矩阵




oracle中分页  如果查询5-10之间的记录/只能利用子查询,不能利用between and

select * from (select rownum rm,empno,empname from emp where rownum<=10) temp where temp.rm>5
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值