keep ()函数

select wzbm,max(dzrq) keep(dense_rank last order by dzrq) from gy_cc_kclsb  group by wzbm

       红色是求分组中最大的dzrq

 

 

例如:  wzbm    dzrq

             1            01

             1            02 

             2            01

             3            09

             3            08

 

求出结果应该是

例如:  wzbm    dzrq

             1            02 

             2            01

             3            09

         

 

你可能感兴趣的:(函数)