I have a table of disparate pieces of data identified by a primary key (ID) and type identifier (TYPE_ID). I would like to be able to fulfill a query that returns me a set of ranges for a given type, broken down into even page sizes. For example, if there are 10,000 records of type "1", and I specify a page size of 1000, I want 10 pairs of numbers to return values ββthat I can use in the sentence BETWEENin subsequent queries to query DB 1000 records in time.
My initial attempt was something like this
select id, rownum from CONTENT_TABLE
where type_id = ? and mod(rownum, ?) = 0
But that does not work.
source
share