Вы можете использовать row_number()
вот демо .
select
type,
user,
version
from
(
select
*,
row_number() over (partition by type, user order by version desc) as rnk
from tool
) t
where rnk = 1
Вывод:
| type | user | version |
| ----- | ----- | ------- |
| type1 | user1 | 2 |
| type2 | user1 | 1 |
| type3 | user2 | 1 |