0
我試圖使用select查詢來顯示我的數據庫中所有在過去發出超過5個投訴的客戶。我試過這個查詢:使用聚合函數作爲過濾條件的SQL
SELECT customer_ID, COUNT(customer_feedback.feedback_type) AS complaints
FROM customer_feedback
WHERE complaints>5
GROUP BY customer_ID;
但它不起作用。 Access無法識別WHERE子句中的表達式「抱怨」。所以我試過了,這更糟糕:
SELECT customer_ID, COUNT(customer_feedback.feedback_type) AS complaints
FROM customer_feedback
WHERE COUNT(customer_feedback.feedback_type)>1
GROUP BY customer_ID;
我確定有一個簡單的解決方案,我現在無法想象。