使用 Zend_Db_Table 从表中选择列的最大值的最简单、最简单的方法是什么?基本上,我只想在 Zend 中运行这个查询:
SELECT MAX(id) AS maxID FROM myTable;
最佳答案
你需要使用 Zend_Db_Expr 来使用 mysql 函数:
return $this->fetchAll(
$this->select()
->from($this, array(new Zend_Db_Expr('max(id) as maxId')))
)
);
关于php - 如何使用 Zend_Db_Table 选择列的 MAX?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5380925/