cancel
Showing results for 
Search instead for 
Did you mean: 

Using 5.11 native sql query, how to retrieve results

studious
Champ in-the-making
Champ in-the-making
I am trying to use a query using native query, this the query I am trying to use.
Select TASK_DEF_KEY_, count(*) count from ACT_HI_TASKINST where delete_reason_ = 'completed' group by TASK_DEF_KEY_;
How can I retrieve the count which is given as an alias for the no.of  tasks that is completed for a specific task definition?

List<HistoricTaskInstance> repo= historyService.createNativeHistoricTaskInstanceQuery().sql("Select TASK_DEF_KEY_, count(*) count from ACT_HI_TASKINST where delete_reason_ = 'completed' group by TASK_DEF_KEY_").list();
for(int n=0; n< repo.size(); n++)
            {
               taskName = repo.get(n).getTaskDefinitionKey();
           
                 // Want to retrieve count, not sure how to
                                      }
1 REPLY 1

trademak
Star Contributor
Star Contributor
Why don't you use the count() method then?

Best regards,