SELECT *
from
(SELECT a.时间,a.`疾病组名称`,a.`医疗费用总额`,row_number() over (partition by a.时间 order by a.`医疗费用总额`desc) as item_num
from 0804shili a) b
where (item_num <=5) ;
结果显示如下:
SELECT *
from
(SELECT a.时间,a.`疾病组名称`,a.`医疗费用总额`,row_number() over (partition by a.时间 order by a.`医疗费用总额`desc) as item_num
from 0804shili a) b
where (item_num <=5) ;
结果显示如下: