zoukankan      html  css  js  c++  java
  • oracle decode case语法

    SELECT col1, col2,   
           CASE   
              WHEN col3 > 1 AND col3 <2   
                 THEN '1'   
              WHEN col3 > 2 AND col3 <3   
                 THEN '2'   
              WHEN col3 > 3 AND col3 <4   
                 THEN '3'   
              ELSE '4'   
           END mylevel   
    FROM table   
      
    select case   
           when    nsrsbh='330165737758262'   then   nsrsbh  
           when    nsrsbh='330106745808709'    then   nsrsbh   
           else     '99999'  
           end   
    from WS_TDS_SQ  
    select case    nsrsbh
           when   '330165737758262'  then  nsrsbh  
           when   '330106745808709'    then   nsrsbh   
           else    '99999'  
           end   
    from table  
      
    decode(条件,值1,返回值1,值2,返回值2,...值n,返回值n,缺省值)  
    decode(字段或字段的运算,值1,值2,值3)  
    select decode (value, <if this value>, <return this value>) FROM table  
      
    select decode(col1,'330165737758262',nsrsbh,'330106745808709',nsrsbh,0) from table 
    select decode(col1,'330165737758262','6','9') from table  
  • 相关阅读:
    rsync+inotify-tools实时备份脚本
    rsync+inotify实现实时同步
    linux 上安装部署python
    rsync全网备份low方法
    rsync 参数说明及使用参数笔记好文摘抄
    rsync 参数说明及使用参数笔记
    js DOM
    导出Excel
    Linux(CentOS 8)安装docker
    Win10安装虚拟机
  • 原文地址:https://www.cnblogs.com/wangdonghua/p/3320886.html
Copyright © 2011-2022 走看看