Aggregate function on hasMany model field

2009-12-11 Thread Manish Pithwa
: SELECT SUM( `Task`.`estimated_hours` ) AS estimated_hour, `Project` . * , `Task`.`project_id` , `Project`.`id` FROM `projects` AS `Project` LEFT JOIN tasks AS Task ON ( Task.project_id = Project.id ) GROUP BY `Project`.`id` Thanks in advance! Manish Pithwa Check out the new CakePHP Questions

Re: Get natural SQL built by Model methods like find, save

2009-12-11 Thread Manish Pithwa
Hi all, I don't want all queries to print just which I want in my code. Thanks Manish Pithwa On Dec 8, 5:46 pm, Pablo Viojo pvi...@gmail.com wrote: If you change debug to 2 in core.php you can see all the queries made. Regards Pablo Viojo pvi...@gmail.comhttp://pviojo.net ¿Que

Get natural SQL built by Model methods like find, save

2009-12-08 Thread Manish Pithwa
(select * from..., update table set field='value'... etc.) . So Please reply if anybody has to solution to get SQL for find and save method against array parameters passed to these. Thanks in advance! Manish Pithwa Check out the new CakePHP Questions site http://cakeqs.org and help others