日期:2014-05-19  浏览次数:20447 次

where条件中出现between and 子句就不能用其他条件了吗
例如
select   money   from   table
where   money   between   100   and   1000
and   id> 1101     //如果加这样的条件就报错

------解决方案--------------------
-----try-----

select money from table
where id> 1101 and money between 100 and 1000


------解决方案--------------------
你的id是不是字符型的?
這樣試試

select [money] from table
where [money] between 100 and 1000
and id> '1101 '

------解决方案--------------------
不會吧?給一些關鍵字加[],給條件加()
select [money] from [table]
where ([money] between 100 and 1000)
and ([id]> 1101)