【发布时间】:2014-07-18 09:11:21
【问题描述】:
我正在尝试列出所有已完成/已完成任务计数的任务(提交中)。问题是我还想显示没有用户完成的所有任务。此查询未列出 count = 0 (Null)。有没有办法做到这一点?
想要的结果:
Date | title | completed
2014-05-20 | Case 1 | 45
2014-05-24 | Case 10 | 11
2014-05-20 | Case 2 | 0
到目前为止我已经尝试过:
Select date, title, count(*) as completed
from users u, submissions s, task t
where u.userPK = s.user
and s.task= t.taskPK
group by taskPK
order by completed desc;
【问题讨论】:
-
date和title属于哪个表? -
日期和标题属于表格任务。
-
你能举一个你想要的输出的例子吗,不太明白你的预期结果。
-
我要列出已完成任务的数量,以及未完成的任务。由(0 或 null)表示。