SELECT U."user_name" 'User Name',C."Name" 'Case Name', SUM(case when C."Status" = 'New' then 1 else 0 end) 'New', SUM(case when C."Status" = 'Assigned' then 1 else 0 end) 'Assigned', SUM(case when C."Status" = 'Pending Input' then 1 else 0 end) 'Pending Input' FROM "cases" C, "Users" U WHERE C."Status" IN ('New','Assigned','Pending Input') and C."assigned_user_id" =U."Id" GROUP BY C."Name" order by U."user_name", C."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!