SELECT U."user_name" 'User Name', SUM(case when C."Status" = 'New' then 1 else 0 end) 'New Cases', SUM(case when C."Status" = 'Assigned' then 1 else 0 end) 'Assigned Cases', SUM(case when C."Status" = 'Pending Input' then 1 else 0 end) 'Pending Input Cases' FROM "Cases" C, "Users" U WHERE C."Status" IN ('New','Assigned','Pending Input') and C."assigned_user_id" =U."Id" GROUP BY U."user_name" order by U."user_name"
Skyvia Query allows you to run SQL queries against databases and cloud applications from web browser. Access and manage your data from anywhere, build reports, arrange your data in the most informative way and simplify your decision-making process easily!