每个类别排名前2位 [英] Top 2 per category

查看:66
本文介绍了每个类别排名前2位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为每个邮政编码获取列中最大和第二大的金额。

然后我想将这两个数字添加到一个表中,该表中包含每个邮政编码的其他信息(例如,计数,总计等等。

我可以获得最高罚款:

展开 | 选择 | Wrap < span class =codeDivider> | 行号

解决方案

< blockquote>任何帮助都将非常感激。

我必须让它工作,我真的卡住了。

谢谢


@Dablette


你在excel或Access工作的数据行大小是什么?


你好Jim,

我相信你能帮助我。感谢您花时间查看我的查询。


我今天使用的原始表格有100,000行。

它有25,000个唯一的邮政编码价值。

在我今天使用的数据中,邮政编码是数字,但其他表格将包含字母数字的邮政编码。表中没有备忘录或很长的字符串字段。

(我希望我理解你关于数据行大小的问题)


该表在Access中。

我在Excel中编写代码,在Access中的表上运行各种查询,并将摘要信息放入Excel工作表中。


I need to get the largest and 2nd largest amounts in a column for each postcode.
I then want to add these two figures to a table which has other information for each postcode (e.g. counts, totals, etc).
I can get largest fine:

Expand|Select|Wrap|Line Numbers

解决方案

Any help with this will be greatly appreciated.
I have to get it working for work, and I''m really stuck.
Thank you


@Diablette
What is your data row size here are you working in excel or Access?


Hi Jim,
I trust you will be able to help me. Thank you for taking the time to look at my query.

The original table that I am working with today has 100,000 rows.
It has 25,000 unique postcode values.
In the data I am working with today the postcodes are numbers, but other tables will have alphanumeric postcodes. There are no memo or very long string fields in the table.
(I hope I understand your question on data row size)

The table is in Access.
I am writing code in Excel which runs various queries on the tables in Access and puts summary information into Excel sheets.


这篇关于每个类别排名前2位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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