Z SQL equivelant of MySQL's SQL_CALC_FOUND_ROWS?

Kevin Monceaux <[email protected]>
Newsgroups gmane.comp.web.zope.database
Message-ID <[email protected]>
Zope Enthusiasts,

I'm new to Zope so forgive me if the answer to this question is obvious.  If
one performs a select with a limit clause is it possible to determine how
many results would have been returned if there was no limit?  For example,
if I wanted to select the first picture in a photo album but wanted to know
the total number of pictures in the album, how would I do that via Z SQL?
With MySQL it can be done this way:

SELECT SQL_CALC_FOUND_ROWS, * from Pictures where AlbumID = 25 LIMIT 1;

SELECT FOUND_ROWS() as Count;

According to the "Z SQL Methods User's Manual" multiple SQL statements can
be included in a Z SQL method but that no more than one select statement can
be included.  The above MySQL technique requires two select statements.



Kevin
http://www.RawFedDogs.net
Bruceville, TX
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.