收到错误代码 1052。字段列表中的列'customer_id'不明确(编码新手)


SELECT SUM(amount), customer_id FROM customer AS c 
JOIN payment p 
ON c.customer_id=p.customer_id
GROUP BY customer_id, amount 
ORDER BY customer_id 
LIMIT 100;

customer_id改为p.customer_idc.customer_id以消除歧义

相关内容