For your particlular example you could try count(Post.title) as `Post`.`count`
In general this sort of thing is done in afterFind(). Just loop over the results and add the extra keys that you need. Geoff -- http://lemoncake.wordpress.com On Aug 8, 7:08 pm, mithesh <[EMAIL PROTECTED]> wrote: > hi pls anybody can help me this is my query now i want the aggregate > function data to be binded to primary model which is Post in this > case . > > $posts=$this->Post->query("SELECT id , count(Post.title) as count>From posts > as Post Group By id"); > > $this->set('posts', $posts); > But the output is in the following way > Array > ( > [Post] => Array > ( > [id] => 1 > ) > > [0] => Array > ( > [count] => 1 > ) > > ) > > I want the data to be like this : > > Array > ( > [Post] => Array > ( > [id] => 1 > [count] => 1 > > ) > > ) > Can anybody help me i wud be greatful --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---