oracle group query

Group query in oracle and query the first few data of each group

select * from (
SELECT b,c,row_number() OVER(PARTITION BY b ORDER BY c desc) e FROM test_table) t where e <= 3

b is the grouping field, c Sort field

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326494136&siteId=291194637
Recommended