title: Is it possible to use GROUP BY with bind variables?
body: <p>I want to issue a query like the following</p>
  
  <pre><code>select max(col1), f(:1, col2) from t group by f(:1, col2)
  </code></pre>
  
  <p>where <code>:1</code> is a bind variable. Using <code>PreparedStatement</code>, if I say </p>
  
  <pre><code>connection.prepareStatement
    ("select max(col1), f(?, col2) from t group by f(?, col2)")
  </code></pre>
  
  <p>I get an error from the DBMS complaining that <code>f(?, col2)</code> is not a GROUP BY expression.</p>
  
  <p>How does one normally solve this in JDBC?</p>