I'm running the feeds Table where I don't want DISTINCT fields with "NULL" to retrieve.
$this->Feed->recursive = 0;
$this->paginate = array('Feed' => array(
'limit' => 6,
'fields' => 'DISTINCT Feed.* IS NOT NULL',
'conditions' => array('Feed.member_id' => $friends_ids),
'order' => array('Feed.created' => 'DESC'),
));
$notes = $this->paginate('Feed');
$this->set('notes', $notes);
// debug($notes);
unset($notes);
This gives me an error. Warning (512): SQL Error: 1054: Unknown column 'Feed.* IS NOT NULL'. Running this on cakephp 1.3 Thanks.
Try moving the NULL check to the conditions array.
'fields' => 'DISTINCT Feed.*',
'conditions' => array(
'Feed.member_id' => $friends_ids,
'Feed.the_field_to_check IS NOT NULL'
),