我正在尝试计算来自每个国家/地区的客户数量,但声明似乎没有起作用。它一直说无效的标识符。计数来自不同国家的客户,国家/地区表将不会加入到客户表(Oracle)
客户位于customer_details表中,然后国家/地区名称由另一个表中的country_id确定。
我似乎无法得到此声明的工作。
SELECT country.country, count(*) AS customer_count
FROM customer_details
INNER JOIN country
ON customer_details.country_id = country.country_id
GROUP by country.country
ORDER by country.country;
任何帮助,将不胜感激。
'从国家加入国家'...你是否指'加入customer_details'? – sgeddes
投票结束,作为一个简单的错字... – sgeddes
对不起,是的customer_details。现在编辑。 – frick3r