I can't figure out why this query works sometimes and fails other times (forgive the grails syntax):
Code:
def total = TestOutcome.executeQuery("select t.analysisState, count(t.analysisState) from cuanto.TestOutcome t where t.testRun = ? group by t.analysisState""", [testRun])
When it works, it works fine, when it fails, I get this error:
Code:
util.JDBCExceptionReporter - Not in aggregate function or group by clause: org.hsqldb.Expression@647a7347 in statement [select testoutcom0_.analysis_state_id as col_0_0_, count(testoutcom0_.analysis_state_id) as col_1_0_, analysisst1_.id as id7_, analysisst1_.version as version7_, analysisst1_.is_analyzed as is3_7_, analysisst1_.is_bug as is4_7_, analysisst1_.is_default as is5_7_, analysisst1_.name as name7_ from test_outcome testoutcom0_ inner join analysis_state analysisst1_ on testoutcom0_.analysis_state_id=analysisst1_.id where testoutcom0_.test_run_id=? group by testoutcom0_.analysis_state_id]