...
Code Block | ||
---|---|---|
| ||
// Produces SELECT * FROM `clients` HAVING `primary_account_type` IS NOT NULL
$this->Record->select()->from("clients")->having("primary_account_type", "!=", null);
// Produces SELECT * FROM `clients` HAVING `primary_account_type` IS NOT NULL OR `id`>'0'
$this->Record->select()->from("clients")->having("primary_account_type", "!=", null)->orHaving("id", ">", 0); |
Aggregate Functions
Code Block | ||
---|---|---|
| ||
// Produces SELECT MAX(`id`) AS `largest_id` FROM `clients` $this->Record->select(array("MAX(id)"=>"largest_id"))->from("clients"); |
...