dtt3401885 2012-11-12 11:00
浏览 278
已采纳

orcal分页语句

String str="select d.id,d.depname,a.id lb,a.name,count(*) sl,sum(t.new_value) yz,sum(t.value) xz,sum(t.new_value)-sum(t.value) jtzj from ASSET_BASIC t,asset_type a,department d where d.id = t.use_department_id and a.id=t.asset_type_id and t.use_department_id is not null and d.company_id = "+com.id+"group by d.id,d.depname,a.id,a.name order by d.id,d.depname,a.id,a.name"这是一个SQL查询。。怎么加上每页显示10条数据。

  • 写回答

1条回答 默认 最新

  • yeqing4562010 2012-11-12 11:12
    关注

    [code="java"]
    select f.* from
    ( select e.*,rownum rowno from (
    ........(你的sql)
    ) e where rownum <= #end#
    ) f where f.rowno >= #start#
    [/code]
    end start分页数据

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?