title: Issues when using HSQL and WHERE statement
body: <p>I have an issue when using a WHERE statement in HSQL. When I enter the code as follows I get no errors:</p>
  <pre><code>&quot;SELECT Year, ProjectName, (cast(sum(Missed) as float)/(select cast(sum(d.Missed) as float) from Draft d)) as MissedPer from Draft group by ProjectName, Year order by ProjectName&quot;
  </code></pre>
  <p>However, when I add a WHERE statement inside the nested query I get an error:</p>
  <pre><code>&quot;SELECT Year, ProjectName, (cast(sum(Missed) as float)/(select cast(sum(d.Missed) as float) from Draft d where Year = '19.12')) as MissedPer from Draft group by ProjectName, Year order by ProjectName&quot;
  </code></pre>
  <p>The error is the following:</p>
  <p>Exception in thread &quot;main&quot; java.sql.SQLSyntaxErrorException: expression not in aggregate or GROUP BY columns:  CAST(( SUM(PUBLIC.DRAFT.MISSED)) AS DOUBLE)/(()) in statement [SELECT BranchNo, ProjectName, (cast(sum(Missed) as float)/(select cast(sum(d.Missed) as float) from Draft d where d.BranchNo = '19.12')) as MissedPer from Draft group by ProjectName, BranchNo order by ProjectName]</p>
  <p>I don't know how to make this work, please help.</p>