wrong created sql query with group and min or max
Closed this issue · 0 comments
carstomas commented
My code:
$rows = $this->db->table('prices')->group('vehicle_id'); return $rows->min('price');
Returned query:
SELECT MIN(price) FROM prices
Right query:
SELECT MIN(price) FROM prices GROUP BY vehicle_id
Sorry, my mistake. ->min($column) return only int