1
I’m making a bank select and it’s returning me 15 lines. I used ROWNUM to pick up the first 8 lines, only I want to do another select and pick up from line 9 to 15.
SELECT * FROM (SELECT DISTINCT o.STORAGE_TYPE, COUNT(o.QUANTIDADE) as
qtd_materiais
FROM mopsao.vw_monitoramento_do@MOPSAO m INNER JOIN VIEW_ORDENS_A_COLETAR o
ON
m.DELIVERY = o.DELIVERY AND m.cod_mat_c = o.MATERIAL WHERE
m.status_andamento = 'Pickado'
GROUP BY o.STORAGE_TYPE ORDER BY qtd_materiais DESC) WHERE ROWNUM <= 8
This first select as I described, take the first 8 lines.
Rownum server to limit records even, apparently you want to do a pagination deal for your application, correct? In this case you need to treat in your application the fetch of the database records, limiting 8 in 8 records. You can look for something specific in the library that you use to make the connection to the oracle, you will probably get a more complete explanation of how to make the pagination
– Confundir