I need to get the max record for each version in Oralce SQL
Price Total_Amount Group Version
10 100 1 20190401.00
11 111 1 20190501.00 --- Print this version
5 50 2 20190401.00 --- Print this version
6 60 3 20190401.00
7 70 3 20190501.00
8 80 3 20190601.00
9 90 3 20190701.00 --- Print this version
The above query was output from
select
sum(price),
sum(Total_amount),
group,
version,
row_number() over(Partition by group order by version) row_num,
dense_Rank over ( order by version) dense_Rank
from Table_name
group by group,version
I tried using Partition on group and dense rank in the above query it gives me max in each group but when i tried to query the result from above its not giving me the result i want
Desired output
Price Total_Amount Group Version
11 111 1 20190501.00
5 50 2 20190401.00
9 90 3 20190701.00