title: MySQL error : sql_mode=only_full_group_by
body: <p>i have this script where i'm used to do a simple projection for a dynamic result</p>
  
  <pre><code>    SELECT 
      M.nom_utilisateur, 
      SUM(M.montant_bulletin ) as Montant_Total_BS,
      SUM(M.montant_payer   ) as Montant_Total_payer,
      COUNT(M.ref_bs ) as nbr_bs_total,
  
  (SELECT COUNT(*) FROM mutuelle_bi.`Mutuelle` WHERE nom_utilisateur = M.nom_utilisateur  AND (M.nom_assurence  = "Star" AND M.etat_bs = "Remboursé")) as nbr_bs_total_payer,
  
  (SELECT COUNT(*) FROM mutuelle_bi.`Mutuelle` WHERE nom_utilisateur = M.nom_utilisateur  AND (M.nom_assurence  = "Star" AND M.etat_bs = "Non remboursé")) as nbr_bs_non_payer,
  
  (SELECT COUNT(*) FROM mutuelle_bi.`Mutuelle` WHERE nom_utilisateur = M.nom_utilisateur  AND (M.nom_assurence  = "Star" AND M.etat_bs = "En cours")) as nbr_bs_en_cours,
  
  (SELECT COUNT(*) FROM mutuelle_bi.`Mutuelle` WHERE nom_utilisateur = M.nom_utilisateur  AND (M.nom_assurence  = "Star" AND M.etat_bs = "Nouveau")) as nbr_bs_nouveau
      FROM mutuelle_bi.`Mutuelle` M
      WHERE M.nom_assurence  = "Star"
      GROUP BY M.nom_utilisateur
  </code></pre>
  
  <p>but something goes wrong ; as i have this error :</p>
  
  <blockquote>
    <p>1055 - Expression #5 of SELECT list is not in GROUP BY clause and
    contains nonaggregated column 'mutuelle_bi.M.etat_bs' which is not
    functionally dependent on columns in GROUP BY clause; this is
    incompatible with sql_mode=only_full_group_by</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/ra8Dm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ra8Dm.png" alt="enter image description here"></a></p>
  
  <p>How may i modify my script by the way to solve this problem , 
  <strong>given that i shouldn't modify any config file  of my sql server</strong> . and i should only write scripts</p>
  
  <p>Any Suggestions ??</p>