Hello gkc,
I have just tried the following in my app:
$vendors = $this->find('all',
array('conditions'=>array('vendor_id >' => 0),
'contain'=>array('Vendor.shortname'),
'fields'=>array('left(Item.product,10) as p10, COUNT(*) as count'), //
'Item.vendor_id,
'group'=>array('Item.vendor_id'),
'order'=>array('COUNT(*) desc'),
//'recursive'=>-1,
)
);
This works like a charm for me.
Array
(
[0] => Array
(
[0] => Array
(
[p10] => 6ES5721-0C
[count] => 3173
)
[Vendor] => Array
(
[shortname] => XYZ
[id] => 377
)
)
[1] => Array
(
[0] => Array
(
[p10] => POG90 2048
[count] => 404
)
[Vendor] => Array
(
[shortname] => Tha
[id] => 35
)
)
Which version of cake are you using ?
On Thu, Feb 5, 2009 at 6:35 PM, gkc <[email protected]> wrote:
>
> Alfredo,
>
> Thank you for finally responding. I REALLY NEED HELP WITH THIS!!!!
Dont cry ;)
Siegfried
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" 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?hl=en
-~----------~----~----~----~------~----~------~--~---