Pavel Stehule wrote:
> 2012/10/22 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
>> Perhaps it would be close enough to what you want to use DISTINCT ON:
>>
>> contrib_regression=# explain select distinct on( t <-> 'foo') *,t <-> 'foo' from test_trgm order by t <-> 'foo' limit 10;
> good tip - it's working
If two or more values happen to be at exactly the same distance,
wouldn't you just get one of them?
-Kevin