Suppose I have ISSUE_MASTER table of Issue.
ISSUE_MASTER Table contains ISSUE_ID,ISSUE_TYPE,PROJECT_ID etc.. columns.
Now I want to count number of issue for every project.
I have tried below codes.
Query query = Query.select("project_id").group("project_id"); Object[] qtmIssueEntity = activeObjects.find(QTMIssueEntity.class, query);
above code failed as I got below exception.
org.h2.jdbc.JdbcSQLException: Column "ACTION_STEP_TYPE" must be in the GROUP BY list; SQL statement:
SELECT ACTION_STEP_TYPE,PROJECT_ID,CREATED_ON,CREATED_BY,PLATFORM,ISSUE_DETAILS,COMPLETE,LAST_UPDATED_BY,TEST_RUN_STATUS,ISSUE_TYPE,ISSUE_KEY,LAST_UPDATED_ON,ISSUE_ID FROM PUBLIC.AO_77491B_ISSUE_MASTER WHERE issue_type = ? GROUP BY project_id [90016-185]
I can't understood why all Column selected inside sql query even though I written Query.select("project_id").
I have also tried below thing.
Object[] qtmIssueEntity = activeObjects.findWithSQL(QTMIssueEntity.class, "PROJECT_ID", "SELECT PROJECT_ID,COUNT(*) as created_on FROM PUBLIC.AO_77491B_ISSUE_MASTER GROUP BY PROJECT_ID"); Object[] qtmIssueEntity = activeObjects.find(QTMIssueEntity.class, query);
In above How to get count of issue.
Community moderators have prevented the ability to post new answers.
Have you ever solved this?
Have you ever solved this?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.