SQL Access group by 使用注意事项
SQL Access group by 使用注意事项
在MS SQL 中正常的语句:
select Field1,sum(Field2) as Field2n from Tables where group by Field1 order by Field2 desc
在Access中会报错:
主要原因是受后缀:order by 的影响,它会把order by 的参数当做合计函数的一部分,应该改成:
select * from (
select Field1,sum(Field2) as Field2n from Tables where group by Field1
) order by Field2 desc
创建时间:2023.01.05 更新时间:
博客园 滔Roy https://www.cnblogs.com/guorongtao 希望内容对你有所帮助,谢谢!