数据库分页sql

  1 oracle
select * from 
(
    select row_.*,rownum rownum_ from 
    (
        select REPLACE(b.name4,'公路局','') as name4 , b.name0 ,
        sum(a.personcount) as personcount, sum(checkvehcount) as checkvehcount, 
        sum(offvehcount) as offvehcount, sum(offvehweight) as offvehweight,
        sum(overfitcount) as overfitcount, sum(escvehcount) as escvehcount
        from t_ds_workinfo a  
        left outer join vres_bmzd b  on a.station=b.uuid where b.vc0 !='001001001'
        group by   name4, b.name0 , si4,si5
        order by si4,si5
     ) row_ where  rownum<5
) where rownum_>0

你可能感兴趣的:(oracle,sql)