zoukankan      html  css  js  c++  java
  • case --when

    1.....................................

    select 
    case substr(JF.Jfssq,6,1)
    when '4' then
    substr(JF.Jfssq,1,4)|| '年'||'第四期'

    when '3' then
    substr(JF.Jfssq,1,4)||'年'||'第三期'

    when '2' then
    substr(JF.Jfssq,1,4)||'年'||'第二期'

    when '1' then
    substr(JF.Jfssq,1,4)||'年'||'第一期'
    else ''
    end as zq from dual

    2.....................................

    select * from dual

    where bgxdm = 'jhzt'
    and bgxxz in (0, 2, 9, 10, 18) --判断非源户 工会状态最近一次变成(0, 2, 9, 10, 18)
    and czsj <![CDATA[<]]> to_date(case substr(#{ssq2,jdbcType=VARCHAR}, 5, 2)
    when '01' then
    substr(#{ssq2,jdbcType=VARCHAR}, 1, 4) || '0101'
    when '02 ' then
    substr(#{ssq2,jdbcType=VARCHAR}, 1, 4) || '0401'
    when '03 ' then
    substr(#{ssq2,jdbcType=VARCHAR}, 1, 4) || '0701'
    when '04 ' then
    substr(#{ssq2,jdbcType=VARCHAR}, 1, 4) || '1001'
    end,
    'yyyymmdd')

  • 相关阅读:
    jdbc代码
    openwrt vsftp
    openwrt 配置samba && ubuntu 配置samba
    如何学习开源项目
    Makefile 笔记
    Samba 学习笔记
    quilt-补丁工具
    to-do-list
    新增feeds模块
    linux命令
  • 原文地址:https://www.cnblogs.com/523823-wu/p/8504718.html
Copyright © 2011-2022 走看看