Re: SQL_CALC_FOUND_ROWS in POSTGRESQL / Some one can

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

 



Chris <dmagick@xxxxxxxxx> writes:
> Their docs explain it:
> http://dev.mysql.com/doc/refman/4.1/en/information-functions.html
> See "FOUND_ROWS()"

Sounds like a pretty ugly crock ...

The functionality as described is to let you fetch only the first N
rows, and then still find out the total number of rows that could have
been returned.  You can do that in Postgres with a cursor:

	DECLARE c CURSOR FOR SELECT ... (no LIMIT here);
	FETCH n FROM c;
	MOVE FORWARD ALL IN c;
	-- then figure the sum of the number of rows fetched and the
	-- rows-moved count reported by MOVE

			regards, tom lane


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux