问题
I've got a homework that includes SQL with MS Access I've been trying hard to figure it out but could'nt.. Im just getting an error message.. My code is for a view..
This is the code:
(SELECT Rum, COUNT(DISTINCT(Larare)) AS antal FROM Kurstillfalle
GROUP BY Rum)
回答1:
Access does not support COUNT(DISTINCT columnname) but you can do this:
SELECT
t.Rum,
COUNT(t.Larare)) AS antal
FROM (SELECT DISTINCT Rum, Larare FROM Kurstillfalle) AS t
GROUP BY t.Rum
来源:https://stackoverflow.com/questions/55328897/how-do-i-convert-this-sql-code-so-that-ms-access-understands-it