zoukankan      html  css  js  c++  java
  • Oracle wm_concat()函数的实际运用

    作用:把一个数据表中多条记录的指定数据列值,以逗号(,)间隔形式返回。

    select decode(V_VALUE_TYPE,'01',wm_concat(order_code),
                                                            '02',wm_concat(to_char(order_date,'yyyy-mm-dd')),
                                                            '03',wm_concat(trim(remark))
                                              )
                                              into ls_return_string              
                                from (
                                       select order_code,factory_code,order_type,order_date,trunc(order_date,'month') order_date_month,remark
                                       from sts_env_report_infor
                                       where  FACTORY_CODE = V_FACTORY_CODE
                                              and
                                              ORDER_TYPE   = V_FLAG
                                              and
                                              trunc(ORDER_DATE,'month')= decode(ln_row,1,V_REPORT_DATE,ldt_max_date)                           
                                     )
                                group by factory_code,order_type,order_date_month;

  • 相关阅读:
    javascript如何封装函数
    addEventListener和attachEvent区别
    Infinity NaN undefined和null
    hasOwnProperty
    蜂巢式图片墙布局
    复选框使用总结
    文本框获得焦点时改变背景颜色
    自定义动画animate
    click()、bind()、live()和delegate()方法
    图片提示效果
  • 原文地址:https://www.cnblogs.com/honliv/p/1987425.html
Copyright © 2011-2022 走看看