티스토리 뷰

DATABASE

이전글, 다음글 Query.

fallacy.kr 여우야뭐하니 2010.10.26 09:23
SELECT  BOARD_CODE, BOARD_TITLE
FROM     T_BOARD
WHERE   BOARD_CODE IN
  (
   (SELECT MAX(BOARD_CODE) FROM T_BOARD WHERE BOARD_CODE < 2),
   (SELECT MAX(BOARD_CODE) FROM T_BOARD WHERE BOARD_CODE = 2),
   (SELECT MIN(BOARD_CODE) FROM T_BOARD WHERE BOARD_CODE > 2)
  )
ORDER BY BOARD_CODE ASC;


댓글
댓글쓰기 폼