如何处理表中的数字数组以查找丢失的数字 [英] How to process an array of numbers from a table to find missing ones

查看:67
本文介绍了如何处理表中的数字数组以查找丢失的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

对于有日期,仪器和表格的表格测试编号,我需要记录每个仪器,最低测试,最高测试和任何缺失的测试,昨天。

有十几种仪器,平均每个仪器的测试数量相同。


到目前为止,我已经编写了以下内容(不适用于所有情况),但我确信有一种更简单的方法来处理每个仪器的数组,对于昨天:

>>>

展开 | 选择 | Wrap | 行号

解决方案

这很难解读你的程序是做什么的因为你还没有给我们表格的元数据。但是根据你对你想要做的描述,你根本不需要运行一个程序。


如果你将一组不同的乐器交叉加入记录集不同的日期,将为您提供您正在寻找的记录的每个组合。然后你把它和外部连接到你的测试表来获得你的最小值,最大值和缺失值。


你用光标做的所有东西都可能是不必要的。


请查找正在处理的样本数据(从光标开始):


12/30/04 ARNK-0085 236

12/30/04 ARNK-0088 21

12/30/04 ARNK-0088 22

12/30/04 ARNK-0088 23
12/30/04 ARNK-0088 24

12/30/04 ARNK-0088 25

12/30/04 ARNK-0089 202

12/30/04 ARNK-0090 191

12/30/04 ARNK-0090 192

12/30/04 ARNK-0090 194

12/30/04 ARSA-0124 195

12/30/04 ARSA-0124 196

12/30/04 ARSB-0003 301

12/30/04 ARSB-0003 302

12/30/04 ARSB-0003 306

12/30/04 ARSB-0037 188

12/30/04 ARSB-0037 189


我不确定你的建议会如何标记,例如ARNK-0090仪器缺失测试193.谢谢


对于具有相同或不同测试的同一台乐器,您是否会在桌面上有不同的日期?


什么是PK这个表是什么?


每个仪器都需要经过一个维度表吗?


~~ CK

Hello,
For a table having date, instrument & test number, I need to log per instrument, the lowest test, the highest test and any missing tests, for yesterday.
There are a dozen instruments, and an average of the same number for tests per instrument.

So far I have written the following (Does not work for all cases), but am sure there is a simpler way to process an array for each instrument, for yesterday:
>>>

Expand|Select|Wrap|Line Numbers

解决方案

It''s hard to decipher what your procedure is doing because you haven''t given us the metadata of your tables. But from your description of what you want to do, you shouldn''t need to run a procedure at all.

If you cross join a record set of distinct instruments to a record set of distinct dates, that will give you every combination of record that you''re looking for. Then you take that and outer join it to your testing table to get your min, max, and missing.

All the stuff that you''re doing with the cursor is probably unnecessary.


Please find sample data that is being processed (from the cursor):

12/30/04 ARNK-0085 236
12/30/04 ARNK-0088 21
12/30/04 ARNK-0088 22
12/30/04 ARNK-0088 23
12/30/04 ARNK-0088 24
12/30/04 ARNK-0088 25
12/30/04 ARNK-0089 202
12/30/04 ARNK-0090 191
12/30/04 ARNK-0090 192
12/30/04 ARNK-0090 194
12/30/04 ARSA-0124 195
12/30/04 ARSA-0124 196
12/30/04 ARSB-0003 301
12/30/04 ARSB-0003 302
12/30/04 ARSB-0003 306
12/30/04 ARSB-0037 188
12/30/04 ARSB-0037 189

I am not sure how your suggestion would flag that, for example, instrument ARNK-0090 is missing test 193. thank you


Are you going to have a different date on the table for the same instrument with the same or not the same test?

What is the PK of this table?

Is there a dimension table for every test that every instrument needs to go through?

~~ CK


这篇关于如何处理表中的数字数组以查找丢失的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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