每个客户的预约次数计数 - Microsoft Access SQL

Count of the number of appointments that each customer has made - Microsoft Access SQL

我正在尝试在 Microsoft Access 中创建一个 SQL 查询,该查询能够计算 每个客户已经进行但迄今为止未成功的约会。我有两张单独的桌子,一张用于预约,一张用于客户,如下所列。

预约

客户

您需要做一些聚合:

SELECT Customer.Customer_ID, Customer.Name, Customer.Lastname, COUNT(*)
FROM Customer
JOIN Appointment
ON Customer.Customer_ID = Appointment.Customer_ID
WHERE Attended <> 'Yes'
GROUP BY Customer.Customer_ID, Customer.Name, Customer.Lastname;

我面前没有 MS Access,所以如果有错字,请告诉我!