我有三张桌子
country_table
: id int, country_name string
city_table
: id int, city_name string, postal_code int, country_id int
customer_table
: id int, customer_name string, city_id id, customer_address string
我正在寻找一个答案,该答案将返回客户数量超过所有城市平均客户数量的所有城市。对于每个这样的城市,返回国家名称、城市名称、客户数量。
输出应该是
country_name, city_name, count
Run Code Online (Sandbox Code Playgroud)
我尝试使用子查询,但出现错误
country_name, city_name, count
Run Code Online (Sandbox Code Playgroud)
非常感谢任何帮助