Re: How to select a row and an adjacent row?
От | Lincoln Yeoh |
---|---|
Тема | Re: How to select a row and an adjacent row? |
Дата | |
Msg-id | 3.0.5.32.20000623142117.0089c360@pop.mecomb.po.my обсуждение исходный текст |
Ответ на | Inheritance question (Richard Harvey Chapman <hchapman@3gfp.com>) |
Ответы |
Re: How to select a row and an adjacent row?
|
Список | pgsql-general |
Hi everyone, Just say I'm doing a select ... from ... where ... order by... I know the row I want, but I also want the row after (or before in another case), and the row I want is NOT at the top/bottom of the order by :(. Is there a way to do it faster than doing the entire select? The reason I have this is because I'm letting the user choose the order of the query. When viewing information based on a particular row, I want to put a "Next" and/or "Prev" button to go to view information based on the next/prev row in the order previously selected, and so on... Storing the query results into a temporary location is starting to look like the way to do it. But as this is a web application, deciding the optimal solution to when and how to delete the results is not easy for me :(. Thanks! Link.
В списке pgsql-general по дате отправления: