title: Firebird SQL group by
body: <p>I want to group by the column <code>factd_poste_fact</code> but I get this error:</p>
  
  <blockquote>
    <p>SQL error code = -104.<br>
    Invalid expression in the select list (not contained in either an aggregate function or the GROUP BY clause).</p>
  </blockquote>
  
  <p>Code:</p>
  
  <pre><code>select
     f.fact_n,
     poste_facture ,
     sum_montant_ttc
  from 
     factures f
  left outer join
     (select
         facture_detail.fact_n,
         (facture_detail.factd_poste_fact) as poste_facture,
         sum(facture_detail.factd_montant_ttc) as sum_montant_ttc
      from 
         facture_detail
      group by    
         (fact_d.fact_n,facture_detail.factd_poste_fact)
  group by
      f.fact_n, poste_facture, sum_montant_ttc
  </code></pre>