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;

  • 相关阅读:
    POJ 1860 Currency Exchange (Bellman ford)
    POJ 1502 MPI Maelstrom (最短路)
    2015 Multi-University Training Contest 2 1006(DFS)
    HDU 1495 非常可乐(枚举+DFS)
    HDU 5289 Assignment(单调队列)
    ACDream 1734 Can you make a water problem?(贪心)
    ACDream 1735 输油管道
    ACDream 1726 A Math game (折半查找)
    CSU 1602 Needle Throwing Game (投针问题)
    CSU 1604 SunnyPig (BFS)
  • 原文地址:https://www.cnblogs.com/honliv/p/1987425.html
Copyright © 2011-2022 走看看