How to fetch data by only one of the two fields with different values in group by grouping in SQL

Table:
ID name value time
1 A 3 2018-1-1
1 A 4 2018-4-4
2 B 6 2018-1-2
3 C 7 2018-1-3
3 C 9 2018-4-6

how to group by ID and only take the most recent value of time (time) under the same ID and name:

such as:

ID name value time
1 A 4 2018-4-4
2 B 6 2018-1-2
3 C 9 2018-4-6

Mar.04,2021

if pg does not support partitioning functions, associate tables more than once, for example:

select id, name, time, max(value)
from t inner join (
select id, name, max(time) as max_time
from t
group by id, name
) t1 on t.id = t1.id and t.name = t1.name and t.time=t1.max_time
group by id, name, time

select * from (
select id,name, value,ROW_NUMBER () OVER (PARTITION BY a.id name ORDER BY a.time DESC) as num
from table a
) b
where b.num = 1

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc902b-38cf0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc902b-38cf0.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?