---------------------------------
List(int page, int scale){
//page 현재 페이지
//scale 출력될 양
int startIndex = ((page -1) * scale) +1;
int endIndex = page * scale;
}
SELECT *
FROM (SELECT /*+ FIRST_ROWS(100) */
ROWNUM rnum,c.*
FROM (SELECT tname, tabtype, clusterid
FROM tab
WHERE tabtype = 'TABLE'
ORDER BY tname) c
WHERE ROWNUM <= ?)
WHERE rnum >= ?
pStmt.setInt(1, endIndex);
pStmt.setInt(2, startIndex);
---------------------------------
SELECT *
FROM (SELECT rownum rnum, tname,tabtype,clusterid
FROM (SELECT tname, tabtype, clusterid
FROM tab
WHERE tabtype = 'TABLE'
ORDER BY tname
)
)
where rnum between ? and ?
pStmt.setInt(1, startIndex);
pStmt.setInt(2, endIndex);
---------------------------------
이 포스팅은 쿠팡 파트너스 활동의 일환으로, 이에 따른 일정액의 수수료를 제공받고 있습니다.
이 포스팅은 제휴마케팅이 적용되어 작성자에게 일정액의 커미션이 제공될수 있습니다.
이 글을 공유하기