Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2118825
  • 博文数量: 1647
  • 博客积分: 80000
  • 博客等级: 元帅
  • 技术积分: 9980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 15:15
文章分类

全部博文(1647)

文章存档

2011年(1)

2008年(1646)

我的朋友

分类:

2008-10-28 17:59:42

select * from 
(select a.*,rownum as my_sys_rownum from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,nvl(ZBTS, '0'),
nvl(FZR,'0'),nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where  rownum<2000 
and ZBRL is null
) a
union
select b.*,rownum+(select count(*) from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,nvl(ZBTS, '0'),
nvl(FZR,'0'),nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where  rownum<2000 
and ZBRL is null
)) as my_sys_rownum from (
select deptid,nvl(BDZNAME,' '),nvl(VOLLEVEL,'0'),ZBRL,
nvl(ZBTS, '0'),nvl(FZR,'0'),
nvl(DEPTIDDES,' '),nvl(TEL,' '),nvl(RUNSTATEDES,' '),
nvl(ADDRESS,' '),BDZID from V_BDZ where  rownum<2000 
and ZBRL is not null order by ZBRL 
) b
)
      order by my_sys_rownum desc

--------------------next---------------------

阅读(96) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~