안녕하세요...
다음이 아니라 SQL에 문제가 있어 질문 올립니다..
다른 게 아니라 ..
변수에 값을 담을 려고 합니다..
유니온 된 INLINE VIEW에서 컬럼값을 변수에 넣을 려고 하는데
Server Message: Number 141, Severity 15
A SELECT statement that assigns a value to a variable must not be combined with data-retrieval operations.
위에 같은 에러가 발생 하네요..
어떤식으로 해결 해야 하나요....
궁금 합니다.. 알려주세요...
쿼리문---------------------
declare @Noti int
select @Noti = aa.noti
from (
select noti
from notice
where num between 1 and 10
union all
select noti
from notice
where num between 21 and 30
) aa
group by aa.noti
|