Select * from MyTable
where myField = 1
And myImportantField ???
...
我有以下参数:
@DoCalculateValues bit,
@FromValue int,
@ToValue int
我需要这个
if @DoCalculateValues = 1 then
check if myImportantField is between @FromValue and @ToValue
else
ignore values, something like "And myImportantValue = myImportantValue"
请考虑这一切都发生在“... WHERE ... AND ...”子句的中间