On Fri, 24 Jul 1998, =?UNKNOWN?Q?=B9=DA=B9=CC=B7=E6?= wrote:
> I want to select like this...
>
> select * from any_table where table_field > any_no limit 10 order by
> table_field DESC;
>
> I want to select more than 1000 rows.
> But, I want to view only 10 from maximum to maximum -10.
>
> How can I ?
>
> I want to make the search engin using Postgresql.
> If more than 10000 rows, there's hard to query, I think...
> Does anybody know about this ?
use cursors:
begin;
declare C cursor for
select * from any_table
where table_field > 10
order by table_field DESC;
move forward 4590 in C;
fetch fetch 10 in C;
end;
I don't know how to move to the end of the result set. Maybe it's possible
to use 'move backward 10 in C' and then 'fetch forward 10 in C', you'll
have to try.
Maarten
_____________________________________________________________________________
| TU Delft, The Netherlands, Faculty of Information Technology and Systems |
| Department of Electrical Engineering |
| Computer Architecture and Digital Technique section |
| M.Boekhold@et.tudelft.nl |
-----------------------------------------------------------------------------