客户多于平均水平的城市。子查询

Ber*_*nür 5 mysql sql inner-join subquery having-clause

我有三张桌子

  • country_tableid int, country_name string
  • city_tableid int, city_name string, postal_code int, country_id int
  • customer_tableid 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)

非常感谢任何帮助