我的申请在不同时间对不同的生物体进行污染,并根据重量计算每双生物的植被数量。 投票每几分钟就进行,结果就会被篡改,并添加到我的SQL桌上。 下表载有以下三栏。 例子显示有3个双目(A、B和C),但同样植被的双双双双双双双双双双双双双双双体可能介于1至10个。 (在1或2个双胞胎中,大植被可能增加两倍)
timestamp bin Widget_Count
--------------------------
1 A 8
2 B 7
3 C 4
4 A 1
5 B 3
6 C 5
7 A 6
8 B 7
9 C 2
申请需要产生一份库存历史报告,这将涉及在每一时间点计算当时所有双目物品的总数。 举例来说,报告将只包含下面的时间栏和上列栏(最后一栏)(其他栏仅显示计算)。
当时有1个A被污染,有8个植被。 B和C没有受到污染。 因此,总数为8个。
当时,B被污染,有7个植被。 因此,总数为17
当时有3个C被污染,有4个植被。 因此,总数为19个。
当时,有4人再次被污染,只有1个植被。 因此,现为1+4+7=12
等等。
timestamp bin Widget_ A B C CountHistory
Count (stock flow)
--------------------------------------------------------
1 A 8 8 0 0 8
2 B 7 8 7 0 15
3 C 4 8 7 4 19
4 A 1 1 7 4 12
5 B 3 1 3 4 8
6 C 5 1 3 5 9
7 A 6 6 3 5 14
8 B 7 6 7 5 18
9 C 2 6 7 2 15
我希望能就如何最好地做到这一点提供任何帮助。 我试图利用一名治疗师制作一张临时表格,通过每个记录进行录音,但无法得到正确的询问。
(我以前曾问过一个相关问题,但我并没有正确地阐述这一问题,也没有举出这个例子。)