类似于我在上一个问题中回答的内容,
ARRAY ofrows就像您建议的和简短的位置符号一样:
SELECt DISTINCT ON (1) p, groundtruth, array_agg(ROW(anchor_id, id)) AS idsFROM ( SELECt DISTINCT ON (1, 2, 3) ps.p, m.groundtruth, m.anchor_id, m.id FROM (SELECT unnest(point_array) AS p) AS ps JOIN measurement m ON ST_DWithin(ps.p, m.groundtruth, distance) ORDER BY 1, 2, 3, random() ) xGROUP BY 1, 2ORDER BY 1, random();
但是我更喜欢带有二维数组的其他版本。



