I've done everything and still keeps sending me the error
$this->db->distinct();
$this->db->select('s.id, COALESCE(SUM(sd.cajas),0) as cajas, COALESCE(SUM(sd.peso),0) as peso, c.nombre');
$this->db->from('separacion s');
$this->db->join('separacion_detalles sd','sd.idseparacion = s.id');
$this->db->join('calidad c','sd.idcalidad = c.id');
$this->db->where('s.idcuenta',$this->session->userdata('idcuenta'));
$this->db->group_by('c.nombre');
$this->db->order_by('peso','desc');
$this->db->limit(5);
return $this->db->get()->result();
Error:
In aggregated query without GROUP BY, expression #1 of SELECT list contains nonaggregated column 'prohassc_origin.s.id'; this is incompatible with sql_mode=only_full_group_by
Does anyone know what's going on?