这个SQL语句该怎样修改?

xwqjamky 2007-01-17 10:55:20
select * from table where a between 1 and 156


但现在只想查找为双数的记录?

select * from table where a in(2,4,6,8,10...........)
这样太长了..



...全文
128 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
wym840713 2007-01-17
  • 打赏
  • 举报
回复
select * from table where a between 1 and 156
and a%2=0
akuzou 2007-01-17
  • 打赏
  • 举报
回复
select * from table where a%2=0 and a<=156
鐵蛋 2007-01-17
  • 打赏
  • 举报
回复
同意wym840713()这位兄弟的select * from table where a between 1 and 156 and a%2=0,另一位兄弟的select * from table where a%2=0 and a<=156可以取到0,这点不符合你的要求

34,593

社区成员

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

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