find('list') mit COUNT kombinieren

2009-04-17 Thread Günther Theilen

Moin,

ist es möglich find('list') mit COUNT zu kombinieren?
Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der 
Häufigkeit des Auftretens als value.
Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer 
find('list')-Abfrage in php auswerten (zählen)?

Danke und Grüße
Günther

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find('list') mit COUNT kombinieren

2009-04-17 Thread Richard
Sehr geehrter Herren -

Ich glaube sie können dies mit GROUP BY. Zum Beispiel:

array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
= 'Product.type');

http://book.cakephp.org/view/74/Complex-Find-Conditions


Mit freundlich Gruessen
Richard



Dear Günther,

I think you can achieve what you're asking for with a GROUP BY query, for
example:

 array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
= 'Product.type');

http://book.cakephp.org/view/74/Complex-Find-Conditions

All the best,
Richard

2009/4/17 Günther Theilen thei...@eqi.de


 Moin,

 ist es möglich find('list') mit COUNT zu kombinieren?
 Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der
 Häufigkeit des Auftretens als value.
 Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer
 find('list')-Abfrage in php auswerten (zählen)?

 Danke und Grüße
 Günther

 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find('list') mit COUNT kombinieren

2009-04-17 Thread Günther Theilen

Hi Richard,

I solved it already with adding array_count_values after the find(). 
Works just fine.

Thanks anyway!

(And sorry for the first post in German. It was a bit early...)

Regards
Guenther


Richard wrote:
 Sehr geehrter Herren -
 
 Ich glaube sie können dies mit GROUP BY. Zum Beispiel:
 
 array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
 = 'Product.type');
 
 http://book.cakephp.org/view/74/Complex-Find-Conditions
 
 
 Mit freundlich Gruessen
 Richard
 
 
 
 Dear Günther,
 
 I think you can achieve what you're asking for with a GROUP BY query, for
 example:
 
  array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
 = 'Product.type');
 
 http://book.cakephp.org/view/74/Complex-Find-Conditions
 
 All the best,
 Richard
 
 2009/4/17 Günther Theilen thei...@eqi.de
 
 Moin,

 ist es möglich find('list') mit COUNT zu kombinieren?
 Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der
 Häufigkeit des Auftretens als value.
 Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer
 find('list')-Abfrage in php auswerten (zählen)?

 Danke und Grüße
 Günther

 
  
 


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: find('list') mit COUNT kombinieren

2009-04-17 Thread banu sundar
Thanks for ur Answer


On Fri, Apr 17, 2009 at 3:04 PM, Richard rclay...@gmail.com wrote:

 Sehr geehrter Herren -

 Ich glaube sie können dies mit GROUP BY. Zum Beispiel:

 array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
 = 'Product.type');

 http://book.cakephp.org/view/74/Complex-Find-Conditions


 Mit freundlich Gruessen
 Richard



 Dear Günther,

 I think you can achieve what you're asking for with a GROUP BY query, for
 example:

  array('fields'=array('Product.type','MIN(Product.price) as price'), 'group'
 = 'Product.type');

 http://book.cakephp.org/view/74/Complex-Find-Conditions

 All the best,
 Richard

 2009/4/17 Günther Theilen thei...@eqi.de


 Moin,

 ist es möglich find('list') mit COUNT zu kombinieren?
 Ich möchte eine Liste erhalten mit dem Wert eines Feldes als key und der
 Häufigkeit des Auftretens als value.
 Geht das mit cake-Bordmitteln? Oder muss ich das Ergebnis einer
 find('list')-Abfrage in php auswerten (zählen)?

 Danke und Grüße
 Günther




 



-- 
By
A.Banusundar

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---