oracle 查询前一百条

 select rownum, id, name, recordDay, payDay, salesDay
               from (select id, name, recordDay, payDay, salesDay
                       from (select id id,
                                    max(NAME) name,
                                    sum(RECORD_DAY) recordDay,
                                    sum(PAY_DAY) payDay,
                                    sum(SALES_DAY) salesDay
                               from diagnosis_rank_product
                              group by id)
                      order by recordDay desc)
              where rownum <= 100

你可能感兴趣的:(oracle)