透過以下sql語句進行計算,為什麼結果有些不準確
public function get_avgprice_item($category_id){
$sql = "SELECT MAX(yj) as m_max, AVG(yj) as m_avg, Min(yj) as m_min FROM " . $this->get_table('item') . ' where category_id = ' . intval($category_id);
return $this->query_row($sql);
}
沒有放錯位置,
為什麼計算出來的結果會這樣子?