ACCESS中的SQL语句count(distinct(字段名))问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 17:19:19
统计不同记录的数目应该可以直接用这个语句的啊count(distinct(字段名))为什么在ACCESS中不行?总是提示dinstinct未定义??怎么回事?难道要一直用
select count(*) from (select distinct * from table)
我现在觉得ACCESS太不方便了。。。。

count(distinct 字段名)
distinct和字段名间有个空格

access其实很好用的

SELECT count(distinct 字段名) FROM table

跟Top连的话

SELECT count top 10 字段名 FROM table

你这个问题我测试过,access 里面的distinct是不能这样是用的啊!
我测试用group by 试过,可以分类统计.
select count([字段名]) as [字段名] from [表名]
group gy [字段名]
完全可以出你想要的结果!