码迷,mamicode.com
首页 > 数据库 > 详细

oracle Group by 分组查询后,分页

时间:2015-04-01 12:55:09      阅读:229      评论:0      收藏:0      [点我收藏+]

标签:

public Map getInWareHouseReport(int i, int j, InWareHouse inWareHouse) {
        //查询分组后总条数
        String countquery="select WS_SKU_ID,sum(IN_NUMBER),sum(WH_MONEY) from IN_WAREHOUSE p group by WS_SKU_ID";
        //计算结束行
        int m=i+j;
        //分组分页查询
        String sqlString="select * from

(SELECT rownum as rn, a.* FROM (select WS_SKU_ID,sum(IN_NUMBER),sum(WH_MONEY) from IN_WAREHOUSE p group by WS_SKU_ID ) a)

where rn>"+i+" and rn<="+m+"";


        List trList = this.excuteSql(sqlString, "inreport");
        List clist = this.excuteSql(countquery, "count");
        int totalProperty = clist.size();
        Map map = new HashMap();
        map.put(TOTAL_PROPERTY, totalProperty);
        map.put(BUSI_LIST, trList);
        return map;
    }

oracle Group by 分组查询后,分页

标签:

原文地址:http://www.cnblogs.com/lengzhijun/p/4383397.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!