clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 2043036 fiddles created (16626 in the last week).

create table t ( target_link_id int, reversed_target_link boolean, source_geometry_id int, reliability double precision ); insert into t values (750, true, 6156655, 96.90882243480968), (750, true, 6156654, 96.3385845004076), (759, false, 299963, 97.88820671302537), (759, false, 299962, 90.81686447596023), (759, false, 4339973, 83.83639328022115), (981, true, 304625, 94.25089913251661), (981, true, 304624, 96.521137788089), (981, true, 304626, 94.21941014522639), (981, true, 304621, 91.93785338486143), (981, true, 304622, 95.27831743865612);
10 rows affected
 hidden batch(es)


with ct as ( select target_link_id, reversed_target_link, source_geometry_id, reliability, row_number() over (partition by target_link_id order by reliability desc) rn from t ) select * from ct where rn = 1;
target_link_id reversed_target_link source_geometry_id reliability rn
750 t 6156655 96.9088224348097 1
759 f 299963 97.8882067130254 1
981 t 304624 96.521137788089 1
 hidden batch(es)