SQL查询:计算每种颜色的可用型号数

SQL查询:计算每种颜色的可用型号数,sql,Sql,计算每种颜色的可用型号数使用计数功能,例如: SELECT color, count(distinct model) FROM table GROUP BY color SELECT colour, COUNT(model) FROM articles ORDER BY colour 您可以在此处看到COUNT函数的用法:此SQL无效,您需要一个组,具体问题是什么?

计算每种颜色的可用型号数

使用
计数
功能,例如:

SELECT color, count(distinct model) 
  FROM table
 GROUP BY color
  SELECT colour, COUNT(model) 
    FROM articles
ORDER BY colour

您可以在此处看到
COUNT
函数的用法:

此SQL无效,您需要一个组,具体问题是什么?