array('fields'=>array('Product.type','MIN(Product.price) as price'), 'group' => 'Product.type');
As you can see, 'MIN(Product.price) as price' is just a function that gets passed through to the SQL and evaluated - you might be able to use that?
Jeremy Burns
Class Outfit
jeremyburns@classoutfit.com
http://www.classoutfit.com
On 30 Mar 2011, at 08:00, thom wrote:
> Hello, I just wonder about how to write Mysql's syntax SUM IF in
> Cakephp. Is there a way to insert it in 'cake-way' or just using
> this->query() ??
>
> Thank you very much.
>
> --
> Regards,,,
> mastanto
> http://www.mastanto.com
> http://thom-sharing.blogspot.com
>
> --
> Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
> Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
>
>
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment