原文:分组排序取次数 函数 row_number() row_number() over (partition by patient_id /*需要分组的列*/ order by zyid /*排序的列*/) sqlSELECT ZYID, patient_id ,row_number() over (partition by patient_id order by zyid) visit_id from jk_patient_in_hospital oracle create or repla
分组排序聚合的例子. Table 9-51. Ordered-Set Aggregate Functions Function Direct Argument Type(s) Aggregated Argument Type(s) Return Type Description mode() WITHIN GROUP (ORDER BYsort_expression) any sortable type same as sort expression returns the most fre