--test table 생성
create table tblTmp(
idx int,
title char(3)
);

--데이타 넣기
insert into tblTmp( idx, title )
select 1, 'abc'
union all
select 2, 'def'
union all
select 3, 'gh '
;

-- #1 이렇게 땜빵은 했는데..
select idx, title
from ( select top 1 idx, title from tblTmp where idx < 2 order by idx desc ) AS aa
union all
select idx, title
from ( select top 1 idx, title from tblTmp where idx > 2 order by idx asc ) AS aa

-- #2 이게 왜 안되누
/*
select top 1 idx, title from tblTmp where idx < 2 order by idx desc
union all
select top 1 idx, title from tblTmp where idx < 2 order by idx desc;
*/

--test 테이블 지우기
drop table tblTmp;


/*
#2로 되어있는 부분이 왜 syntax error인지 당최 모르겠습니다.
초급은 살짝 넘지 않았나 생각했는데 당황스럽네요...
*/