如何在 zend框架中使用 aggerate function
$select = $this->select()->from(dailyusages, new Zend_Db_Expr("SUM(offPeakTotal)"));
答案 0 :(得分:0)
示例
$select = new Zend_Db_Select($dbadapter);
$result = $select
->from(
'table_name',
array(
'offPeakTotalSum' => 'SUM(offPeakTotal)'
)
)
->query(Zend_Db::FETCH_ASSOC)
->fetch();
var_dump($result);