我有一个包含SQL和MS Access的作业,我一直在努力弄清楚,但不能。.我只是收到一条错误消息。.我的代码用于视图..
这是代码:
(SELECT Rum, COUNT(DISTINCT(Larare)) AS antal FROM Kurstillfalle
GROUP BY Rum)
答案 0 :(得分:1)
访问不支持COUNT(DISTINCT列名),但是您可以这样做:
SELECT
t.Rum,
COUNT(t.Larare)) AS antal
FROM (SELECT DISTINCT Rum, Larare FROM Kurstillfalle) AS t
GROUP BY t.Rum