zoukankan      html  css  js  c++  java
  • postgresql case when then end 以及字符串处理的用法

    条件

    case s.×××                                                     

    when 'A'
         then (case when S.×× is null then '' else '' end)
    when 'B'
         then( case when S.×× is null then '' else '' end)
    when 'C'
         then( case when S.×× is null then '' else '' end) 
                                                                                                       

    else s.order_class end

    字符串连接以及截取某段字符串

     

              table1.userid|| COALESCE((
                SUBSTR(table1.username, position(  '(' IN table1.username) ,

                  position(')' IN table1.username) -  position( '(' IN table1.username) +1)

     

     

    其中  position(  '(' IN table1.username) ‘(’在字段中的位置,返回int型;

           position(')' IN table1.username) -  position( '(' IN table1.username) +1)获取()中的内容

           substr(字符串,起始位置start,截取长度 index)

     

  • 相关阅读:
    LNMP架构三
    LNMP架构二
    LNMP架构
    LAMP架构三
    LAMP架构二
    LAMP架构
    rsync工具介绍
    mysqldump备份单表数据
    阿铭每日一题 day 14 20180125
    阿铭每日一题 day 13 20180124
  • 原文地址:https://www.cnblogs.com/luoyaoquan/p/2128818.html
Copyright © 2011-2022 走看看