我有这个代码来获取价格列的总数,虽然我希望它只将那些处于“声明”状态的人的总和加起来
public function getAllSales()
{
$stmt = $this->conn->prepare("Select sum(Price) AS total From tbl_orderlist");
$stmt->execute();
$result = $stmt->fetch();
return $result;
}
答案 0 :(得分:-1)
早些时候回答了几乎相同的问题...... LOL
Select COUNT(*) as total From tbl_orderlist WHERE status = 'Claimed';