首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

这个SQL语句该怎样修改?解决方法

2012-02-05 
这个SQL语句该怎样修改?select*fromtablewhereabetween1and156但现在只想查找为双数的记录?select*fromtab

这个SQL语句该怎样修改?
select   *   from   table   where   a   between   1   and   156  


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

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




[解决办法]
select * from table where a%2=0 and a <=156
[解决办法]
select * from table where a between 1 and 156
and a%2=0
[解决办法]
同意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,这点不符合你的要求

热点排行