开发者

How can I use MySQL GROUP BY modifier WITH ROLLUP in Zend_Db_Select?

开发者 https://www.devze.com 2023-02-08 20:31 出处:网络
The SQL query in my web application(PHP/MySQL + Zend) uses a number of parameters to build the search query. However, the records fetched should be grouped by two columns to get sub totals. WITH ROLLU

The SQL query in my web application(PHP/MySQL + Zend) uses a number of parameters to build the search query. However, the records fetched should be grouped by two columns to get sub totals. WITH ROLLUP seems to be a good solution to 开发者_C百科find subtotals, but Zend_Db_Select doesn't support this modifier. Is there any work around?


Well,

$select->from(array('t1' => 'table1'))
    ->where("where");
    ->group("(field1)  WITH ROLLUP");
0

精彩评论

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