大家好(我在堆栈上的第一篇文章!),
这有效:
where
Tran_date between @FromDate and @ToDate
and Range = @Range
and Store_ID =
case when @Range = 'RangeName' then
1234
else
Store_ID
end
但我怎样才能做到这一点?:
where
Tran_date between @FromDate and @ToDate
and Range = @Range
and Store_ID
case when @Range = 'RangeName' then
not in (1234, 5678)
else
Store_ID
end