Hello guys,
I need a "distinct" list of items, so that I tried to set this up
using the following code, but it's not working:
$list = $this->Model->find('list',array('fields' => 'DISTINCT
`Model`.`field`', 'conditions' => array("Model.field2 !=
'-1'"),'order' => 'Model.order ASC'));
Unfortunately the result query is this:
SELECT `Model`.`field`, DISTINCT `Model`.`field` FROM `models` AS
`Model` WHERE `Model`.`field2` != '-1' ORDER BY `Model`.`order` ASC
Which is not what I need, there's an extra `Model`.`field`, that
breaks the query. Do you have an idea of how to get the results I'm
looking for?
Thanks in advance
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---