Example #1
0
 public function testSelectDistinctStatement_Having()
 {
     $query = new Query("SELECT DISTINCT id, description FROM `test` WHERE id > 10 GROUP BY type_id HAVING SUM(qty) > 10");
     $query->having("status = 1");
     $this->assertEquals("SELECT DISTINCT id, description FROM `test` WHERE id > 10 GROUP BY type_id HAVING (SUM(qty) > 10) AND (`status` = 1)", (string) $query);
 }