보통 my-sql에서는 PK로 잡고 auto-increment를 많이 사용하는데 이를 오라클 DB로 마이그레이션 하면서 다음과 같이 한다.....
원본 my-sql 쿼리: select no, gno, ono, nested, id, name, title, registerDate, readno ] from tableName order by gno desc, ono asc limit 0, 15
오라클로 변환된 쿼리 select * from (select a.*,rownum rnum from (select * from table_notice order by gno desc, ono asc) a) where rnum > 페이지당 리스트 수* ( 원하는페이지 번호 - 1) and rownum <= 페이지당 리스트 수
rownum으로 번호를 매기는 것이 order by보다 우선 순위가 높단다. 그리고 위의 방식 말고도 인덱스를 이용한 방법도 있는데..