MSSQL 페이징 쿼리
SELECT * FROM 테이블명 WHERE thread in ( SELECT TOP 20 thread FROM ( SELECT TOP 1020 thread FROM 테이블명 ORDER BY thread DESC ) AS A ORDER BY thread ASC ) ORDER BY thread DESC 해석) 첫번째 Sub Query : SELECT TOP 1020 thread FROM 테이블명 ORDER BY thread DESC => thread 번호 : 1 ~ 1020 (Top 1020) => thread 번호 : 1020 ~ 1 (ORDER BY thread DESC) 두번째 Sub Query : SELECT TOP 20 thread FROM (첫번째 Sub Query : 1020~1) AS A O..
MSSQL
2010. 12. 13. 16:58
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크