zoukankan      html  css  js  c++  java
  • mysql 查询奇偶数

    1、特殊字符处理

      1.1 奇数 &1

    select
       bi.file_type   FILE_TYPE,
       bi.file_batchid   FILE_BATCHID,
       bi.file_path   FILE_PATH,
       conf.save_servercode  SAVE_SERVERCODE,
       bi.execution_order   EXECUTION_ORDER
    from
      tbentrymanage_bi  bi
    left join tbentrymanage_conf  conf  on  (bi.file_type = conf.file_type  and  bi.systemstatus = conf.systemstatus)
    where
         bi.save_status = '0'
    and  bi.systemstatus = '1'
    and  bi.execution_order&1   ##字段&1 查询数据大于等于1的奇数。字段execution_order=(execution_order>>1)<<1 ; 查询数据大于等于2的偶数。 xml中&转义两种形式:1)& 2)<![CDATA[&]]>
    order by file_type , execution_order
    

    执行结果:

     2)偶数  字段=(字段>>1)<<1

     2、mod 取余方法

      2.1 奇数 mod 2 = 1

      2.1 偶数 mod 2 = 0

    缘于生活,而归于工作。本人所书,而意于分享。 如有转载,请注明出处! --活出自己范儿
  • 相关阅读:
    struts2类型转换
    struts2拦截器
    计算机系统结构
    struts2标签
    struts2 OGNL表达式
    使用bootstrap
    Struts2-综合项目
    拦截器,课3
    struts2之OGNL
    Struts2框架
  • 原文地址:https://www.cnblogs.com/Small-sunshine/p/11587042.html
Copyright © 2011-2022 走看看