mysql5.7 upgrade issue GROUP BY incompatible with sql_mode=only_full_group_by
<p>I upgraded my server to mysql5.7 and i have this issue on this request:</p>

<blockquote>
  <p>Error Number: 1055</p>
  
  <p>Expression #1 of SELECT list is not in GROUP BY clause and contains
  nonaggregated column 'vuillermoz.pi.id_pierre' which is not
  functionally dependent on columns in GROUP BY clause; this is
  incompatible with sql_mode=only_full_group_by</p>
</blockquote>

<pre><code>SELECT          `pi`.`id_pierre`, 
                `pi`.`couleur_nom`, 
                `pi`.`couleur_code`, 
                `pi`.`image`, 
                count(p.id_prod) AS countproduits 
FROM            (`produit` p) 
LEFT JOIN       `categorie` c1_4 
ON              `p`.`afficher` = `p`.`afficher` 
AND             p.rid_cat = c1_4.id_cat 
AND             c1_4.afficher = 1 
LEFT OUTER JOIN `categorie` c1_3 
ON              `c1_4`.`rid_cat` = `c1_3`.`id_cat` 
AND             c1_3.afficher = '1' 
LEFT OUTER JOIN `categorie` c1_2 
ON              `c1_3`.`rid_cat` = `c1_2`.`id_cat` 
AND             c1_2.afficher = '1' 
LEFT OUTER JOIN `categorie` c1_1 
ON              `c1_2`.`rid_cat` = `c1_1`.`id_cat` 
AND             c1_1.afficher = '1' 
LEFT OUTER JOIN `type` t 
ON              `p`.`rid_type` = `t`.`id_type` 
INNER JOIN      `pierre` pi 
ON              `p`.`rid_pierre` = `pi`.`id_pierre` 
LEFT OUTER JOIN `matiere` ma 
ON              `p`.`rid_matiere` = `ma`.`id_matiere` 
LEFT OUTER JOIN `couleur` co 
ON              `p`.`rid_couleur` = `co`.`id_couleur` 
WHERE           `rid_pierre` &lt;&gt; 20 
AND             `p`.`afficher` = 1 
AND             ( 
                                p.id_prod IN 
                                ( 
                                       SELECT rid_prod 
                                       FROM   produit__sexe 
                                       WHERE  rid_sexe IN ("1"))) 
AND             ( 
                                p.id_prod IN 
                                ( 
                                       SELECT rid_prod 
                                       FROM   produit__decli 
                                       WHERE  stock &gt; "0") 
                OR              p.disposurcommande = "1") 
GROUP BY        `pi`.`couleur_nom` 
ORDER BY        `couleur_nom` ASC
</code></pre>

<p>can i fix the request instead of changing the  sql_mode param ?
best regards</p>