zoukankan      html  css  js  c++  java
  • Oracle 分页查询 插叙不出数据

    进行分页查询时 使用了rownum关键字导致查询时查询不出数据 ,修改 给rownum字段取个别名,规避oracle关键字

    select * from
    (select  rownum,row_.* from
    (select vil.*, c.audit_title, nvl(vil.update_time,'0001-01-01') update_time2, u.user_name as user_name, prop.property_name as pname, param.description as description from hmfs_bas_village vil left join hmfs_bas_property prop on vil.property_id = prop.id left join hmfs_auth_village_audit c on c.village_id = vil.id and c.audit_state = '03024001' left join hmfs_sys_param param on vil.audit_state = param.param_value left join hmfs_auth_user u on u.id = vil.updater where 1=1 and vil.audit_state = '03024001' order by coalesce(vil.update_time, '0001-01-01') desc)
    row_ )
    where rownum < 20 and rownum >= 10

    select * from
    (select rownum as rownum_,row_.* from
    (select vil.*, c.audit_title, nvl(vil.update_time,'0001-01-01') update_time2, u.user_name as user_name, prop.property_name as pname, param.description as description from hmfs_bas_village vil left join hmfs_bas_property prop on vil.property_id = prop.id left join hmfs_auth_village_audit c on c.village_id = vil.id and c.audit_state = '03024001' left join hmfs_sys_param param on vil.audit_state = param.param_value left join hmfs_auth_user u on u.id = vil.updater where 1=1 and vil.audit_state = '03024001' order by coalesce(vil.update_time, '0001-01-01') desc)
    row_ )
    where rownum_ < 20 and rownum_ >= 10

  • 相关阅读:
    APPlication,Session和Cookie的区别
    C# 中的Request对象的应用
    从字符串里提取一个列表(数组)
    UDP:用户数据报协议
    反射
    网络编程
    多线程
    final,finally和finalize的区别
    集合
    StringBuffer
  • 原文地址:https://www.cnblogs.com/UUUz/p/12023561.html
Copyright © 2011-2022 走看看