How do i convert this sql CODE so that MS Access understands it?

时间秒杀一切 提交于 2020-01-05 05:31:05

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!