When I upgraded my ubuntu from 15.10 to 16.04 I have this error in my yii project: 

> 
> CDbCommand failed to execute the SQL statement: SQLSTATE[42000]:
>  Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column
>  'v4master.A.id' which is not functionally dependent on columns in
>  GROUP BY clause; this is incompatible with
>  sql\_mode=only\_full\_group\_by. The SQL statement executed was:
> 
> 
> 

The sql code is follows:

```
 $sql = "SELECT A.*,B.`type_name` FROM `".$this->tbl_auth_user_items."` A 
                INNER JOIN `".$this->tbl_auth_context_types."` B ON A.`type_id` = B.`type_id` 
                WHERE A.`user_id` = '".$user_id."' GROUP BY A.`type_id`, A.`type_value` ORDER BY A.`type_id` DESC";
         return $this->_db->createCommand($sql)->queryAll(); 

```