I wrote a query like this:
select agent_id,count(id) as agentCount from demo.table lst where lst.agent_id in(:idpList) group by agent_id order by agentCount ASC;
but this only returns the agent_id which are in idp List i also want to get the ids that are in the list but not in demo.table and return count as 0 . i am not able to figure out how can i do that.
eg : List : [20,17,16,15,50] so 50 is not the table but yet i want 50 to be included in the end result.
i have two DB from one i am getting all the agent_id and storing it in List and in another DB i have table that stores the id and no of task associated with these id so i want to check how many times task has been created corresponding to these agent_id and get the count but as these some of agent_id are present in 2nd DB table but some are not so for the one that are not present count should return 0 but from this query i am getting the count of only those that are present in the second DB table
Help would be appreciated.