SQL语法错误(缺少运算符)

时间:2016-08-30 09:51:06

标签: mysql ms-access

我有这个问题:

SELECT COUNT (DISTINCT Class)
    from student ;

我得到了:

  

此查询中的语法错误(缺少运算符)。

1 个答案:

答案 0 :(得分:0)

你可能在此之后:

SELECT COUNT(*) As ClassCount
FROM (SELECT DISTINCT Class FROM student);

或:

SELECT COUNT(*) As ClassCount
FROM (SELECT DISTINCT Class FROM student) AS T;