The solution is rather simple:
$this->User->findAll(null, 'DISTINCT User.city');
Or with the array syntax:
$this->User->findAll(null, array('DISTINCT User.city'));
Please notice that the keyword “DISTINCT” has to be uppercase, else you will get the following error:
Unknown column 'distinct User.city'
2007年7月28日 星期六
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言