如何搜索id为单数或双数的记录 单数 (id % 2)=1双数 (id % 2)=0 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 求单数select * from where id%2=1求双数select * from where id%2=0 求单、双数select case when id%2=0 then '单数' else '双数' end id from 表 (id % 2)=1 (id % 2)=0 我是这样写的:select * from 产品 where ((产品id)%2=1)好像不能计算啊? TRY:select * from 产品 where 产品id%2=1 try: select * from 产品 where (产品id%2)=1 sql server 和 access 都试过啊产品id%2 有计算就出错产品id=1 比较就能通过 select * from 产品 where (cast(产品id as int)%2)=1 产品id是什么类型啊,int型肯定没问题, char我也试过,如果都是数字也没有问题。可以类型转换一下试试。select * from 产品 where convert(int,产品id)%2=1 产品id是access下的自动编号型 SQL Server DBA工作内容详解【技术分享帖】 熟悉vc++6.0利用ado访问数据库的朋友进来看看吧! SQL相关问题? 求一insert SQL 语句 求解 关于数据库被质疑的问题(suspect) 问一个中文,字符,数字的混合查询问题(难处理) 如何用连接字符串以共享方式打开vfp数据表或是关闭后立即释放连接? 急!!用ACCESS修复工具不能修复的错误 why??不认全程变量?? 请问怎么用sql语句对表aaa加个属性字段?谢谢20分 请教分页效率问题?
select * from where id%2=1
求双数
select * from where id%2=0
select case when id%2=0 then '单数' else '双数' end id from 表
(id % 2)=0
好像不能计算啊?
select * from 产品 where 产品id%2=1
select * from 产品 where (产品id%2)=1
产品id%2 有计算就出错
产品id=1 比较就能通过
select * from 产品 where convert(int,产品id)%2=1