zoukankan      html  css  js  c++  java
  • Oracle中wm_concat()的使用方法

            以下两种方式使用wm_concat()的使用方法是等效的。

    方法一:使用窗口函数,wm_concat支持窗口函数

    select distinct classKey,className, classOrder, weekDayKey, lessonkey, lessonName, lessonType,
        wm_concat(subjectkey) over(partition by classKey,className, classOrder, weekDaykey, lessonkey, lessonName,lessonType),
        wm_concat(subjectName)  over(partition by classKey,className, classOrder, weekDaykey, lessonkey, lessonName,lessonType)
    from VW_CLASSCourseTable
    Where schoolKey = P_SchoolKey
    And gradeKey = P_GradeKey
    And termKey = P_TermKey
    order by classOrder asc, weekDaykey asc, lessonType asc 


    方法二:使用group by方式

    select classKey,className, classOrder, weekDaykey, lessonkey, lessonName, lessonType,
        wm_concat(subjectkey),
        wm_concat(subjectName)
    from VW_CLASSCourseTable
    Where schoolKey = P_SchoolKey
    And gradeKey = P_GradeKey
    And termKey = P_TermKey
    group by classKey,className, classOrder, weekDaykey, lessonkey, lessonName,lessonType
    order by classOrder asc, weekDaykey asc, lessonType asc ;
  • 相关阅读:
    S03E01 蓝牙操作
    GET与POST方法
    Http请求头与响应头
    HttpClient初步
    Http
    深度为H的满k叉树
    html5-css选择器
    html5-css的使用强制优先级
    html5-样式表的使用-初步
    html5-css的引入
  • 原文地址:https://www.cnblogs.com/wala-wo/p/5119276.html
Copyright © 2011-2022 走看看