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 ;
  • 相关阅读:
    python module introduce
    python代码基
    20100911部署更新
    汉王ocr
    wsgi
    css布局模板
    Making a simple web server in Python.
    20100910更新部署
    tw.forms usage
    python web shell
  • 原文地址:https://www.cnblogs.com/wala-wo/p/5119276.html
Copyright © 2011-2022 走看看