Nope, that just gives me a list of 1's. I can
already get the total count of the bugs, but I can't seem to get the associated bugs along with it.
So the query I already posted
Code:
select distinct outc.bug from TestOutcome outc where outc.testRun = ? and outc.bug is not null
returns each of the bugs that I want, but not the total count of TestOutcomes with those bugs.
If I do this
Code:
select count(outc.bug) from TestOutcome outc where testRun = ? and outc.bug is not null group by outc.bug
I get the total count of each of the bugs, (in this case 4,8,1,6) but I don't know which bug is associated with each total. So really, I want the results from query A and query B in the same query, but my attempts to combine them have been unsuccessful.
But if I add ", outc.bug" to the query B, so it's like this:
Code:
select count(outc.bug), outc.bug from TestOutcome outc where testRun = ? and outc.bug is not null group by outc.bug
then I get "SQLException: Not in aggregate function or group by clause"
If I leave off the "group by" in the last query and just do this:
Code:
select count(outc.bug), outc.bug from TestOutcome outc where testRun = ? and outc.bug is not null
then I
still get "SQLException: Not in aggregate function or group by clause"
Code:
select count(outc.bug), distinct outc.bug from TestOutcome outc where testRun = ? and outc.bug is not null
gets me "QuerySyntaxException: unexpected token: , near line 1, column 23"
Anyway, what I'm trying to do seems like it should be really simple, but for whatever reason I can't get the syntax right. If somebody who knows the answer could reply it would be very appreciated.