• 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

  • 相关阅读:
    IE7局部滚动区域下绝对定位或相对定位元素不随滚动条滚动的bug
    Webstorm编译TypeScript报错
    Javascript动态创建 style 节点
    css多栏自适应布局
    禁用右键
    Mac下启动和停止Mysql服务
    codemirror
    JavaScript 中的事件流和事件处理程序(读书笔记思维导图)
    mac压缩文件乱码
    Mybatis框架五:动态SQL
  • 原文地址:https://www.cnblogs.com/UUUz/p/12023561.html
Copyright © 2020-2023  润新知