Tuesday, January 12, 2010

Paging with SQL mysql: startrow and maxrows
SELECT * FROM person ORDER BY LAST_NAME DESC LIMIT 11, 10
oracle: startrow and endrow
SELECT s.*
FROM (
 SELECT ROWNUM as COUNTER, x.*
 FROM (
  SELECT p.NAME, p.FIRST_NAME, p.LAST_NAME
  FROM person p
  ORDER BY p.LAST_NAME DESC
 ) x
) s
WHERE s.COUNTER BETWEEN 5 AND 8;

No comments: