Search Postgresql Archives

Re: Slow query: select * order by XXX desc offset 10 limit 10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello

you should to use a DECLARE statement

http://www.postgresql.org/docs/9.1/interactive/sql-declare.html

and fetch statement

http://www.postgresql.org/docs/9.1/interactive/sql-fetch.html

Regards

Pavel Stehule


2011/10/14 Alexander Farber <alexander.farber@xxxxxxxxx>:
> I've also tried opening cursor:
>
> quincy=> open ref for select to_char(qdatetime, 'YYYY-MM-DD') as
> QDATETIME,ID,NAME,CATEGORY,APPSVERSION,OSVERSION,DETAILS,DEVINFO from
> quincyview where qdatetime <= now() order by QDATETIME desc ;
> ERROR:  syntax error at or near "open"
> LINE 1: open ref for select to_char(qdatetime, 'YYYY-MM-DD') as QDAT...
>        ^
>
> --
> Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux