vendredi 8 mai 2015

Sum query in codeigniter

I need to do sum query and after I must compare this sum with a threshold. This is my code:

$this->db->select("id,SUM(sumColum)");
    $this->db->from('p');
    $this->db->group_by('id');
    $query=$this->db->get();

Now I can compare the sum with a threshold value? Anyone can help me?

Aucun commentaire:

Enregistrer un commentaire