访问数据库分组依据 [英] access database groupby

查看:83
本文介绍了访问数据库分组依据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
我需要一个选择语句组,计数,平均值和最大值.这是我到目前为止所拥有的,但是我仍然有错误.谁能告诉我我哪里出问题了?

Hi there,
I need a select statement group by, count, average and max. This is what i have so far but i still have error. Can anyone tell me where I went wrong?

SELECT [Name], count (*) as cnt, MAX([Duration]) as maxDur, format AVG([Duration]) as avgDur FROM tbContractors groupby [Name]



在此先感谢



Thanks in advance

推荐答案

,您缺少了具有吸引力的线索
you are missing the Having cluase


我已经通过使用访问查询获得了它. br/>
I''ve got it by using access query..

SELECT tbContractors.Name, Avg(tbContractors.Duration) AS AvgOfDuration, Max(tbContractors.Duration) AS MaxOfDuration, Count(tbContractors.Duration) AS CountOfDuration FROM tbContractors GROUP BY tbContractors.Name


谢谢.


Thanks.


这篇关于访问数据库分组依据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆