for example: SELECT A.*,count(case when B.id is NULL then NULL else 1 end) as num FROM B right join A on B.a_id=A.id group by A.id
I know i can use $model->execute($sql). Is there any other ways, like "left join" can use $belongsTo? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php -~----------~----~----~----~------~----~------~--~---
