Re: How do you select from a table until a condition is met?
От
Dmitry Tkach
Тема
Re: How do you select from a table until a condition is met?
Дата
Msg-id
3E4AC4E1.3040700@openratings.com
Ответ на
Re: How do you select from a table until a condition is met? (Nicholas Allen)
Список
Дерево обсуждения
How do you select from a table until a condition is met? Nicholas Allen <nallen@freenet.co.uk>
Re: How do you select from a table until a condition is met? Dmitry Tkach <dmitry@openratings.com>
Re: How do you select from a table until a condition is met? Nicholas Allen <nallen@freenet.co.uk>
Re: How do you select from a table until a condition is met? Bruno Wolff III <bruno@wolff.to>
Re: How do you select from a table until a condition is met? Nicholas Allen <nallen@freenet.co.uk>
Re: How do you select from a table until a condition is met? Bruno Wolff III <bruno@wolff.to>
Re: How do you select from a table until a condition is met? Nicholas Allen <nallen@freenet.co.uk>
Re: How do you select from a table until a condition is met? Dmitry Tkach <dmitry@openratings.com>
Possible bug in Postgres? Followup to "How do you select from a table until a condition is met?" Nicholas Allen <nallen@freenet.co.uk>
Re: Possible bug in Postgres? Followup to "How do you select from a table until a condition is met?" Bruno Wolff III <bruno@wolff.to>
Re: Possible bug in Postgres? Followup to "How do you select from a table until a condition is met?" Nicholas Allen <nallen@freenet.co.uk>
Re: Possible bug in Postgres? Followup to "How do you select Peter Childs <blue.dragon@blueyonder.co.uk>
Re: Possible bug in Postgres? Followup to "How do you select Nicholas Allen <nallen@freenet.co.uk>
Re: Possible bug in Postgres? Followup to "How do you select Peter Childs <blue.dragon@blueyonder.co.uk>
Debugging postmaster to fix possible bug in Postgres? Followup to "How do you select Nicholas Allen <nallen@freenet.co.uk>
Re: Debugging postmaster to fix possible bug in Postgres? Followup to "How do you select Tom Lane <tgl@sss.pgh.pa.us>
Re: Debugging postmaster to fix possible bug in Postgres? Followup to "How do you select Nicholas Allen <nallen@freenet.co.uk>
Re: Debugging postmaster to fix possible bug in Postgres? Stephan Szabo <sszabo@megazone23.bigpanda.com>
Re: Debugging postmaster to fix possible bug in Postgres? Followup to "How do you select Manfred Koizar <mkoi-pg@aon.at>
Re: Debugging postmaster to fix possible bug in Postgres? Followup to "How do you select Nicholas Allen <nallen@freenet.co.uk>
Re: Debugging postmaster to fix possible bug in Postgres? Followup Dmitry Tkach <dmitry@openratings.com>
Re: Debugging postmaster to fix possible bug in Postgres? Followup Tom Lane <tgl@sss.pgh.pa.us>
Re: Debugging postmaster to fix possible bug in Postgres? Followup Manfred Koizar <mkoi-pg@aon.at>
Re: How do you select from a table until a condition is met? Dmitry Tkach <dmitry@openratings.com>
Re: How do you select from a table until a condition is met? Nicholas Allen <nallen@freenet.co.uk>
Re: How do you select from a table until a condition is met? Dmitry Tkach <dmitry@openratings.com>
> > >No. What I'm saying is the user scrolls through a list then selects an item. >They then decide to sort on something else but they still want the item they >selected to be selected after the sort has completed. So I need some way to >work out where the previously selected item will be in the new sort order so >I can scroll to that position and select it again. > >eg If user selects "John Doe" when sorted by First name and then decides to >sort by Surname I still want John Doe selected and the user should be able to >see the record. > > What do you mean by 'select the item'? Get all the rows before it? This still doesn't make much sense to me - you said before, that the whole purpose of your 'browser' was to avoid sending tons of data to the client side, but if I understand correctly what you are thinking about doing, it won't work, because you do not know how many rows are before the 'selected' item. Am I still missing something? Anyway, what about this: select * from people order by last_name, id limit 100; -- get first 100, ordered by the last_name select * from people where first_name < 'John' or first_name = 'John' and last_name <= 'Doe' and id <= "JohnDoe's ID" order by first_name, id; -- get everything before the last seen John Doe ordered by the first name select * from people where first_name > 'John' or first_name = 'John' and last_name >= 'Doe' and id >= "JohDoe's ID" order by first_name, id limit 100; -- get 100 rows after the selected one sorted by first name etc... Still can't imagine how this can be useful though :-( Dima
В списке pgsql-sql по дате отправления
От: Bruno Wolff III
Дата: