开发者

Zend framework paginator distinct

If I have a query like:

SELECT DISTINCT unnest(test) AS "test" FROM table ORDER BY "onderwerp" ASC LIMIT 10

The amount of pages is never right as it will add another query:

SELECT COUNT(1) AS "zend_paginator_row_count" F开发者_StackOverflow社区ROM table

What is the best way to get the right amount of pages with a distinct query?


From http://framework.zend.com/manual/en/zend.paginator.usage.html (the The DbSelect and DbTableSelect adapter section), you can specify the query to use to get the count.

$adapter->setRowCount(<a new query to get just the count>);

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜