下面的查询工作正常,并根据我的需要返回正确的结果
select top 1 SID from vSTable where (ID in
(select ID from Engine where Name='nnn' OR Name='mmm')
and QuestionTypeID=1 and IsOfficial=1) order by vSTable.ITime desc;
但是当我这样使用它时
declare @SVal as int
set @SVal = select top 1 SID
from vSTable
where (
ID in
(select ID from Engine where Name='nnn' OR Name='mmm')
and QuestionTypeID=1
and IsOfficial=1
) order by vSTable.ITime desc;
我在 select stmt 附近收到错误的语法错误