好的,我有一个稍微复杂的MySQL查询
SELECT
childcare_attendance.supplier_id,
suppliers.name As `Childcare Provider`,
Count(families.ufi) As Attended,
families.ufi
FROM
childcare_attendance
LEFT OUTER JOIN
suppliers ON suppliers.id = childcare_attendance.supplier_id
LEFT OUTER JOIN
clients ON childcare_attendance.client_id = clients.id
LEFT OUTER JOIN
families ON clients.family_id = families.id
WHERE
childcare_attendance.trashed <> 1
GROUP BY
childcare_attendance.supplier_id, families.ufi
我的问题是我想创建一份报告,列出参加每个托儿所的独特家庭数量。我假设上述查询将执行任务,尽管托儿服务提供者多次展示,我不确定为什么。
修改
这是一个没有数据的SQL小提琴(我将在那里获取一些测试数据)