I have following query in CodeIgniter:
$this->db
->select($this->vehicle_table.'.idvehicle, mark, type')
->group_by('mark')
->order_by('vehicles.mark', "desc")
->get($this->vehicle_table)
->result_array();
In my table I have record like:
type: auto mark: VW
and
type: bus mark: VW
This query works fine, but I'm getting only record (for VW) where type:auto, this query is ignoring type: bus
I have to "group by" two columns, right?
How should I write query to reach records separately by type and mark ?
edit
Solved, i added "->group_by('type')" before "->group_by('mark')".
Sory for that question, it was easy :)