SQL for search page results
Posted in 1997
I am implementing a simple web-based search engine that will return 20 items per page with previous/next link to view the previous or next 20 items. I'd like to create a cursor result set from an SQL statement that only has the 20 that I am currently displaying in the result set. I have not been able to figure out how to do this. I am currently getting all of the results that match the search criteria, then skipping the first X results, depending upon what page of 20 items I am displaying, then displaying the next 20 results, and ignoring the rest. This does not seem very efficent. Is there a better way to approach this? Is there a RowNum or something that I can include in the SQL WHERE statement? I am using Informix Online Workgroup 7.12 on Sun Solaris 2.5.1 and interfacing to it via Netscape Enterprise server 3.0 Livewire. Please reply to tauren@groovee.com. Thanks, Tauren