Header Ads Widget

Responsive Advertisement

[mysql] 게시판 이전글 다음글 쿼리 board prev, next sql

SELECT B.*
FROM Board B
WHERE B.id IN (
(SELECT id FROM Board WHERE id < 32 ORDER BY isTop DESC, refer DESC, step ASC, level ASC LIMIT 1),
(SELECT id FROM Board WHERE id > 32 ORDER BY isTop ASC, refer ASC, step DESC, level DESC LIMIT 1)
);,

댓글 쓰기

0 댓글