我有这个代码:
SELECT TransactionDate, CustomerName, TreatmentName, Price
FROM MsCustomer mc, HeaderSalonServices hss,DetailSalonServices dss, MsTreatment mt, MsStaff ms
WHERE mc.CustomerId = hss.CustomerId AND hss.StaffId = ms.StaffId
AND hss.TransactionId=dss.TransactionId and dss.TreatmentId=mt.TreatmentId
AND StaffName LIKE 'Ryan%' and DATENAME(WEEKDAY, TransactionDate)='thursday'
ORDER BY CustomerName, TreatmentName
COMPUTE SUM(price) BY CustomerName
它不会运行,并且一直说“'COMPUTE'附近的语法不正确”我做错了什么?
这是我的 ERD: