title: JDBCTemplate not giving appropriate result with parameters
body: <p>I am using <code>NamedParameterJdbcTemplate</code> to run a SQL in Oracle. It runs absolutely fine when run in the Oracle database, while passing the params in SQL developer, but it gives a nested exception while using the <code>JdbcTemplate</code></p>
  
  <pre><code>java.sql.SQLSyntaxErrorException: ORA-00979: not a GROUP BY expression
  </code></pre>
  
  <p>I am passing the params through a map as given below.</p>
  
  <pre><code>select to_char(c.created_dt, :GROUP_FORMAT) as point
        ,count(*) as CNT
    from tableA c
   where trunc(c.created_dt) &gt;= to_date(:START_DATE,'YYYY-MM-DD')
     and trunc(c.created_dt) &lt;= to_date(:END_DATE,'YYYY-MM-DD')
   group by to_char(c.created_dt, :GROUP_FORMAT)
  
  return jdbcTemplate.query(sql,
           ImmutableMap.&lt;String, Object&gt;builder()
             .put("GROUP_FORMAT", groupFormat)
             .put("END_DATE", Date.valueOf(endDate))                                                                  
             .put("START_DATE", Date.valueOf(startDate))
             .build(), (rs, rowNum) -&gt; {
               ClassToMap data = ClassToMap.builder().point(rs.getString(1)).count(rs.getInt(2)).build();
               return data;});
  </code></pre>
  
  <p>The issue is mainly with the <code>GROUP_FORMAT</code> parameter, have verified hard-coding the <code>GROUP_FORMAT</code> and it works fine. The values of <code>GROUP_FORMAT</code> passed will be <code>'YYYYMMDD'</code> or <code>'YYYYMM'</code></p>
  
  <p>Expect the output to be an array of <code>ClassToMap</code> objects.</p>