티스토리 뷰
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 ORDER BY thread ASC
=> thread 번호 : 1020 ~ 1001 (Top 20)
=> thread 번호 : 1001 ~ 1020 (ORDER BY thread ASC)
1001,1002, ~ 1020까지 20개 추출
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크