对某个字段相同的值根据另一个字段排序(Oracle数据库)
SELECT a.id, a.material_code,
RANK() OVER(PARTITION BY a.material_code ORDER BY a.id DESC) RK
FROM scm_ws_sc_mtl_h_tbl a
对某个字段相同的值根据另一个字段排序(Oracle数据库)
SELECT a.id, a.material_code,
RANK() OVER(PARTITION BY a.material_code ORDER BY a.id DESC) RK
FROM scm_ws_sc_mtl_h_tbl a