Re: How to select a row and an adjacent row?

From: Dustin Sallings <dustin(at)spy(dot)net>
To: Lincoln Yeoh <lylyeoh(at)mecomb(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: How to select a row and an adjacent row?
Date: 2000-06-23 07:31:25
Message-ID: Pine.NEB.4.10.10006230027250.282-100000@foo.west.spy.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 23 Jun 2000, Lincoln Yeoh wrote:

I do this same type of thing in my photo album
(http://bleu.west.spy.net/~dustin/photo/) and that's exactly what I do,
store the result set. Since the data can change while users are looking
at it (more data can be inserted that would show up in arbitrary places in
search results), the only way it could make sense to the end-user is for
me to let the user flip through his own result set.

This is done in a servlet, so it's a little easier to do that than
it would be in a straight CGI, but it could be done anywhere.

# 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.
#
#

--
dustin sallings The world is watching America,
http://2852210114/~dustin/ and America is watching TV.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Lincoln Yeoh 2000-06-23 08:03:03 Re: How to select a row and an adjacent row?
Previous Message Lincoln Yeoh 2000-06-23 06:46:38 Re: Transactions and web applications