I would like to know the best way to implement paging in queries.
Currently, I am doing something like this:
SELECT
columns
FROM
(SELECT columns FROM table ORDER BY column)
WHERE
rownum BETWEEN start AND end
Is this the best way to go about it?
Yes, that’s the best way I know by far. If you are working with SQL Server, you may combine Row_Number and CTE together. Take a look at http://www.sqlteam.com/article/server-side-paging-using-sql-server-2005
and for MySQL
of course you should replace [offset] and pagesize with appropriate values.