SELECT BOARD_CODE, BOARD_TITLE
FROM T_BOARD
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;
(
(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;
'DATABASE' 카테고리의 다른 글
[MYSQL] characterset 변경 (0) | 2010.12.15 |
---|---|
oracle jdbc Resource 설정- SID 일때, SERVICE NAME 일때. (0) | 2010.10.25 |
[mysql] date_format() 에 사용되는 형식 구분자. (0) | 2010.10.14 |