where条件中出现between and 子句就不能用其他条件了吗

marf_cn 2007-03-07 09:53:05
例如
select money from table
where money between 100 and 1000
and id>1101 //如果加这样的条件就报错
...全文
501 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
baggio785 2007-03-07
  • 打赏
  • 举报
回复
select [money] from table
where ([money] between 100 and 1000)
and [id]>1101
marf_cn 2007-03-07
  • 打赏
  • 举报
回复
可以了,多谢各位
playwarcraft 2007-03-07
  • 打赏
  • 举报
回复
不會吧?給一些關鍵字加[],給條件加()
select [money] from [table]
where ([money] between 100 and 1000)
and ([id]>1101)
paoluo 2007-03-07
  • 打赏
  • 举报
回复
你的id是不是字符型的?
這樣試試

select [money] from table
where [money] between 100 and 1000
and id>'1101'
leo_lesley 2007-03-07
  • 打赏
  • 举报
回复
-----try-----

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

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧