我有以下从 Zend_DB_Table_Abstract 扩展的查询
$select = $this->select()
->from('expense_details',
array('SUM(expense_details_amount) AS total'))
->where('YEAR(expense_details_date) = ?', '2010')
->where('MONTH(expense_details_date) = ?', '01')
->where('expense_details_linkemail = ?', 'xxxx@gmail.com');
然而,尽管它的“等效”返回了所需的值,但它返回了一个 NULL 值
SELECT SUM(expense_details_amount) AS total FROM expense_details
WHERE
YEAR(expense_details_date) = '2010'
AND MONTH(expense_details_date) = '01'
AND expense_details_linkemail = 'xxxx@gmail.com'
我上面的 Zend_DB_Table 构造正确吗?