如何计算列中每个不同条目出现的次数? [英] How do I count how many times each distinct entry in a column appears?

查看:132
本文介绍了如何计算列中每个不同条目出现的次数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在

Access列中准确计算不同的不同条目。起初,我试图使用三个列,但是

我已经将它缩小到一个以简化它。我搜索了Google

群组中的不同计数和计数,Microsoft帮助文件(其中
显然在Office 2003中有错误的链接),并查看了其他文件,

但我找不到答案。我能得到的最接近的是

创建一个查询来查找不同的条目,并计算总数($ 500 $ b),但是我有一个200000多个条目的列表,我需要知道
知道这些不同的项目出现在主列表中的次数。


例如,我的专栏如下:

First_Description

描述A

描述B

描述C

描述A

描述D

描述A

描述B


什么我'我最终希望有一个报告,或者我可以将b $ b导出到Excel的表格(因为它不到65000个不同的行)

看起来像这样:

First_Description出现次数

描述A 3

描述B 2

描述C 1

描述D 1


我知道这听起来很简单,但对于生活o对我来说,我无法想象

out。我做过的最好的就是:

SELECT Count([First Descriptions] .First_Description)AS

CountOfFirst_Description1,[First Descriptions] .First_Description

FROM [Select Distinct],[First Descriptions]

GROUP BY [First Descriptions] .First_Description

ORDER BY Count([First Descriptions] .First_Description),[第一个

描述] .First_Description;


但是,这个查询昨晚跑了5个多小时,而且从未出现过。

我现在正在尝试,但我知道它会很慢。

感谢您的帮助!非常感谢!

基思

I am trying to get a exact count of different distinct entries in an
Access column. At first, I was trying to work with three columns, but
I''ve narrowed it down to one to simplify it. I''ve searched Google
Groups for Distinct Count and Count, the Microsoft Help file (which
apparently has bad links in Office 2003), and looked at other files,
but I can''t find the answer. The closest I''ve been able to get is to
create a query to find the distinct entries, and to make a total count
of those (50000+), but I have a list of 200000+ entries, and I need to
know how many times those distinct items appears in the main list.

For example, my column looks like this:
First_Description
Description A
Description B
Description C
Description A
Description D
Description A
Description B

What I''d ultimately like to have is either a report, or a table that I
can export to Excel (since it''s less than 65000 distinct rows) that
looks like this:
First_Description # of occurances
Description A 3
Description B 2
Description C 1
Description D 1

I know this may sound simple, but for the life of me, I can''t figure it
out. The best I''ve done is this:
SELECT Count([First Descriptions].First_Description) AS
CountOfFirst_Description1, [First Descriptions].First_Description
FROM [Select Distinct], [First Descriptions]
GROUP BY [First Descriptions].First_Description
ORDER BY Count([First Descriptions].First_Description), [First
Descriptions].First_Description;

But, this query ran for over 5 hours last night, and it never came up.
I''m trying it again now, but I know it will be slow.
Thanks for all your help! It is appreciated!
Keith

推荐答案

2005年1月21日06:06:41 -0800, ke***@s116160440.onlinehome.us 写道:


创建一个新的查询,并选择你的表格。

将描述字段拖到网格TWICE。

将第一个留在Group By。

设置第二个计数。


-Tom。

On 21 Jan 2005 06:06:41 -0800, ke***@s116160440.onlinehome.us wrote:

Create a new query, and select your table.
Drag the Description field to the grid TWICE.
Leave the first one at Group By.
Set the second one to Count.

-Tom.

我试图准确计算一个不同的不同条目
访问列。起初,我试图使用三个列,但是我已将其缩小到一个以简化它。我搜索了Google
Groups for Distinct Count and Count,Microsoft帮助文件(显然在Office 2003中有错误的链接),并查看了其他文件,
但我可以'找不到答案。我能得到的最接近的是创建一个查询来查找不同的条目,并计算那些(50000+)的总数,但我有一个200000+的列表条目,我需要知道这些不同的项目出现在主列表中的次数。

例如,我的专栏看起来像这样:
First_Description
描述A
描述B
描述C
描述A
描述A
描述B

我会最终喜欢有一个报告,或者我可以导出到Excel的表格(因为它不到65000个不同的行)
看起来像这样:
First_Description#of出现
描述A 3
描述B 2
描述C 1
描述D 1

我知道这听起来很简单,但对于我的生活,我无法理解
了。我做过的最好的就是:
SELECT Count([First Descriptions] .First_Description)AS
CountOfFirst_Description1,[First Descriptions] .First_Description
FROM [Select Distinct],[First Descriptions] ]
GROUP BY [第一描述] .First_Description
ORDER BY Count([First Descriptions] .First_Description),[First
Descriptions] .First_Description;

但是,这个查询昨晚跑了5个多小时,它从未出现过。
我现在正在尝试,但我知道它会很慢。
感谢您的帮助!非常感谢!
基思
I am trying to get a exact count of different distinct entries in an
Access column. At first, I was trying to work with three columns, but
I''ve narrowed it down to one to simplify it. I''ve searched Google
Groups for Distinct Count and Count, the Microsoft Help file (which
apparently has bad links in Office 2003), and looked at other files,
but I can''t find the answer. The closest I''ve been able to get is to
create a query to find the distinct entries, and to make a total count
of those (50000+), but I have a list of 200000+ entries, and I need to
know how many times those distinct items appears in the main list.

For example, my column looks like this:
First_Description
Description A
Description B
Description C
Description A
Description D
Description A
Description B

What I''d ultimately like to have is either a report, or a table that I
can export to Excel (since it''s less than 65000 distinct rows) that
looks like this:
First_Description # of occurances
Description A 3
Description B 2
Description C 1
Description D 1

I know this may sound simple, but for the life of me, I can''t figure it
out. The best I''ve done is this:
SELECT Count([First Descriptions].First_Description) AS
CountOfFirst_Description1, [First Descriptions].First_Description
FROM [Select Distinct], [First Descriptions]
GROUP BY [First Descriptions].First_Description
ORDER BY Count([First Descriptions].First_Description), [First
Descriptions].First_Description;

But, this query ran for over 5 hours last night, and it never came up.
I''m trying it again now, but I know it will be slow.
Thanks for all your help! It is appreciated!
Keith






我现在正在尝试(这与我的方式相反)它)。现在查询已经过了两个小时运行
...希望它很快会弹出!我会在这里发布

结果。


谢谢!

基思

I''m trying it now (it''s the reverse of how I had it). The query has now
run for the last two hours...hopefully it will pop up soon! I''ll post
the outcome here.

Thanks!
Keith




您可能希望在描述列中添加一个索引来加速

列表。


ron of chi


You may wish to add an index to your ''Description'' column to speed the
tabulation.

king ron of chi


这篇关于如何计算列中每个不同条目出现的次数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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