rownum 的用法 要用select嵌套才可以的

 select * from
(

select VREGION,
       HREGION,
       CDRTYPE,
       TELNUM,
       OTHERTELNUM,
       IMSI,
       MSRN,
       MSCID,
       STARTTIME,
       DURATION,
       SERVICECODE,
       LOCALFEE,
       ROAMFEE,
       SOURFILENAME,
       TOLLFEE,
       PROCESSTIME,
       BILLINGCYCLE,
       '[' || ERRORCODE || ']' ||
       (select name
          from code_dict
         where catalog = 'ERRORCODE'
           and code = ERRORCODE) as ERRORCODE,
       rownum rownum1
  from GSMEMPTYCDR
 where VREGION = '634'
   and ((errorcode not like 'BAK_%' and errorcode not like 'NEW_%') or
       errorcode is null)
)  where
    rownum1 > 5
   and rownum1 <= 11

你可能感兴趣的:(rownum 的用法 要用select嵌套才可以的)