Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> How do I return N results per page + total number of results
I'm able to return search results w/ N results per page. What I'd like
to be able to add is text similar to: Showing results 20-29 of 125
results. How can I return the total number for results w/o executing
the query twice?
Here's my current query:
select * from (
select rownum rn, Q.* from (
select id, type, name
from mytbl where content (name, '$<search_key>') > 0 order by type, name
I've tried adding max, count functions at various points in the query, but they won't work since they are group functions and I'm attempting to combine them w/ multiple rows.
Thanks,
David
![]() |
![]() |