Re: [pgsql-advocacy] Function which gives back the nearest neighbours

Поиск
Список
Период
Сортировка
От Christopher Kings-Lynne
Тема Re: [pgsql-advocacy] Function which gives back the nearest neighbours
Дата
Msg-id 42464392.9040903@familyhealth.com.au
обсуждение исходный текст
Ответ на Function which gives back the nearest neighbours of a requested value  ("Virgile Beddok" <virgile.beddok@igd.fraunhofer.de>)
Ответы Re: [pgsql-advocacy] Function which gives back the nearest neighbours  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-admin
> I'm looking for an existing function which allows me to search the nearest
> neighbours of the requested value.

Well you could try something like:

SELECT * FROM table ORDER BY ABS(val - 2) LIMIT 1;

That doesn't get you all the way there, but it's an idea...

Chris

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Dr. Roger Wießner"
Дата:
Сообщение: PostgreSQL: ´GRANT ALL TO PUBLIC´ ?
Следующее
От: Michael Fuhr
Дата:
Сообщение: Re: Question about trace session