Greg Sabino Mullane wrote: > >>> Granted, I use a few MySQL features for this; I'm not sure if LIMIT >>> exists in postgresql, and I'm fairly sure that the SQL_CALC_FOUND_ROWS >>> directive (which will return the total rows in a select statement >>> regardless of the LIMIT directives) doesn't... > > Postgres has LIMIT and OFFSET. To determine the number of rows returned, > you can simply look at the return value of execute, or you can call > $sth->rows: > > my $numrows = $sth->execute(1,2,42); > > my $numrows2 = $sth->rows;
But will this return the total rows or just the rows that match the LIMIT ... OFFSET ... directive? In MySQL, at least, it will return the latter. The SQL_CALC_FOUND_ROWS directive is to calculate the former. Issac