[sql]이전 글, 제목, 다음 글, 제목

SELECT no,title from table
WHERE no = (SELECT max(no)
                 FROM table
                 WHERE no < '${id}')


SELECT no,title from table
WHERE no = (SELECT min(no)
                 FROM table
                 WHERE no > '${id}')

 

Scroll to Top