单数  (id % 2)=1
双数  (id % 2)=0

解决方案 »

  1.   

    求单数
    select * from where id%2=1
    求双数
    select * from where id%2=0
      

  2.   

    求单、双数
    select case when id%2=0 then '单数' else '双数' end id from 表
      

  3.   

    (id % 2)=1
      (id % 2)=0
      

  4.   

    我是这样写的:select * from 产品 where ((产品id)%2=1)
    好像不能计算啊?
      

  5.   

    TRY:
    select * from 产品 where 产品id%2=1
      

  6.   

    try:
      select * from 产品 where (产品id%2)=1
      

  7.   

    sql server 和 access 都试过啊
    产品id%2 有计算就出错
    产品id=1 比较就能通过
      

  8.   

    select * from 产品 where (cast(产品id as int)%2)=1
      

  9.   

    产品id是什么类型啊,int型肯定没问题, char我也试过,如果都是数字也没有问题。可以类型转换一下试试。
    select * from 产品 where convert(int,产品id)%2=1
      

  10.   

    产品id是access下的自动编号型