query builder HAVING clause |
Hello!
I'm trying to write SQL with query builder(QB). I want to use HAVING clause with MIN() function in it. In Mysql CLI everything works fine, but QB produce string with "IS NULL" in the end. $this->db->HAVING('MIN(sp.s_price)', null, false); $this->db->HAVING('MIN(sp.s_price)', '', false); It's didn't help. Code: SELECT `s`.`s_code`, `sp`.`s_price` PHP Code: $srvcCode = 'q'; I found workaround $this->db->having("MIN(sp.s_price)", "MIN(sp.s_price)", false); But It's not a good practice. Is it a bug or I didn't understand something? English isn’t my first language, so please excuse any mistakes (11-10-2015, 04:20 PM)mIden Wrote: Hello! Your HAVING clause missed an operator. That's why Query Builder issues an IS NULL for it. You can read about SQL HAVING here and QB having() here |
Welcome Guest, Not a member yet? Register Sign In |