Re: best way to retreive the next record in a multi column index
В списке pgsql-hackers по дате отправления:
| От | Bruno Wolff III |
|---|---|
| Тема | Re: best way to retreive the next record in a multi column index |
| Дата | |
| Msg-id | 20030815201503.GA14932@wolff.to обсуждение исходный текст |
| Ответ на | best way to retreive the next record in a multi column index ("Merlin Moncure" <merlin.moncure@rcsonline.com>) |
| Список | pgsql-hackers |
On Fri, Aug 15, 2003 at 13:42:23 -0400, Merlin Moncure <merlin.moncure@rcsonline.com> wrote: > > Example: > I have a table t with columns a, b, c. I have values a1, b1, c1 for > those columns and would like to know the next value in the table when > ordered by a, b. I have values a1, b1, and oid1 and would like to find > the very next record in the table (essentially looking for the next > record in the index). > > I have two solutions: one with 'or' logic and one with 'and' logic. > Note: if the index we are scanning has the unique constraint, the oid > part of the logic (and the index) can be left out. > How about something like the following: select * from t where a >= a1 and b >= b1 order by a, b limit 1 offset 1;
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера