What do you mean by "it doesn't work"...?  any more details?

--Lapinski


gimperdaniel wrote:
> 
> 
> I am having a problem with SELECT DISTINCT
> 
> This is what I have in my model:
> 
> This works:
> 
> $this->find('all', array('fields'=>array('DISTINCT Album.id',
> 'Album.year'), 'recursive'=>-1));
> 
> This Doesn't Work:
> 
> $this->find('all', array('fields'=>array('DISTINCT Album.year'),
> 'recursive'=>-1));
> 
> 
> Album_id is a unique (index) field. Is that why it works on the first
> one and not on the second one?
> > 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Select-Distinct-only-for-Unique-fields--tp26100117p26103511.html
Sent from the CakePHP mailing list archive at Nabble.com.


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to