--一等奖学金
select top 2 cpcj_xh as 一等奖学金
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC--二等奖学金
select top 4 cpcj_xh as 二等奖学金
from cpcj
where cpcj_xh not in
(select top 2 cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC) and
cpcj_bjh = '0304' and
cpcj_xnh = '03-04' and
cpcj_flag = 0
order by cpcj_cpcj DESC --三等奖学金
select top 8 cpcj_xh as 三等奖学金
from cpcj
where cpcj_xh not in
(select top 6 cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04' and
cpcj_flag = 0
order by cpcj_cpcj DESC) and
cpcj_bjh = '0304' and
cpcj_xnh = '03-04'
order by cpcj_cpcj DESC
select top 2 cpcj_xh as 一等奖学金
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC--二等奖学金
select top 4 cpcj_xh as 二等奖学金
from cpcj
where cpcj_xh not in
(select top 2 cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC) and
cpcj_bjh = '0304' and
cpcj_xnh = '03-04' and
cpcj_flag = 0
order by cpcj_cpcj DESC --三等奖学金
select top 8 cpcj_xh as 三等奖学金
from cpcj
where cpcj_xh not in
(select top 6 cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04' and
cpcj_flag = 0
order by cpcj_cpcj DESC) and
cpcj_bjh = '0304' and
cpcj_xnh = '03-04'
order by cpcj_cpcj DESC
解决方案 »
- REGEXP_LIKE的返回类型
- 请教一个怎样提高数据插入效率的问题
- 如何创建临时表
- Oracle企业管理器中关闭数据库需要填主机用户和密码,vista homepremium,请问怎么填?我以管理员登陆,并填了信息,结果说主机密码错误,怎么解决
- 请教一个SQL语句,自动为没有数据的月份填0
- oracle里可以从一个表里取出数据插入另一个表吗?刚学的!
- 安装问题,提示(Database Configuration Assitant:错误)
- ORACLE9I导出数据时当导出数据文件到4G就停止导出了,请问是何原因?
- ###存储过程使用游标增加、删除、更新数据?
- 表达心情。散分!
- 有没有这种sql?
- 哪错了,郁闷???
from (
select cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC
) where rownum <= 2
select cpcj_xh as 一等奖学金
from (
select cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC
) where
select cpcj_xh as 一等奖学金
from (
select cpcj_xh
from cpcj
where cpcj_bjh = '0304' and
cpcj_xnh = '03-04'and
cpcj_flag = 0
order by cpcj_cpcj DESC
) where rownum <= 2