有三个单位,每个单位各有前十名,现在要将想取出三个单位合计的前十名并删除其他的二十名,求SQL
表结构如下表A
unit_id 单位代码 key,
unit_name 单位名称,
man_id 个人代码 key,
man_name 个人名称,
money 钱
表结构如下表A
unit_id 单位代码 key,
unit_name 单位名称,
man_id 个人代码 key,
man_name 个人名称,
money 钱
解决方案 »
- Oracle 11g中的SQL developer 连接中的connection name填什么?
- sql 空值问题
- 程序执行到一条SQL 的时候就不动了
- ORA-00936:缺失表达式
- 小妹恳求大家回答个问题!!为什么在toad中能显示小数,在aix显示不了
- 要访问Oracle数据库,是不是必须安装Oracle客户端?
- 请大家帮忙给广域网的数据库一致性下个定义
- 如何在处罚器中得到当前操作的类型?
- 怎样在JDBC中调用Oracle的一个存储过程,并且此存储过程返回一个结果集,放在ResultSet中?
- 求一段时间去除星期六和星期天的SQL语句
- 请问有知道TRS数据库的吗
- 大侠请帮忙看一下,我在更新数据的时候报了下面一个错误。
select *
from your_table
where rownum <11
order by money;
select * from
(select * from your_table where 第一个单位 and rownum <11 order by money
union
select * from your_table where 第二个单位 and rownum <11 order by money
union
select * from your_table where 第三个单位 and rownum <11 order by money)
where rownum <11 order by money
(select * from your_table where 第一个单位 and rownum <11 order by money desc
union
select * from your_table where 第二个单位 and rownum <11 order by money desc
union
select * from your_table where 第三个单位 and rownum <11 order by money desc)
where rownum <11 order by money desc
(select * from your_table where 第一个单位 and rownum <11 order by money desc
union
select * from your_table where 第二个单位 and rownum <11 order by money desc
union
select * from your_table where 第三个单位 and rownum <11 order by money desc)
where rownum <11 order by money desc
select * from
(select * from
(select * from (select * from your_table where 第一个单位 order by money desc) where rownum < 11
union all
select * from (select * from your_table where 第二个单位 order by money desc) where rownum < 11
union all
select * from (select * from your_table where 第三个单位 order by money desc) where rownum < 11)
order by money desc)
where rownum < 11