我正在使用FileMaker的ExecuteSQL
函数执行以下SQL:
SELECT "location", "account", SUM("amount")
FROM "TEMP"
GROUP BY "location", "account"
它给了我非常奇怪的结果。
LOC01,Account 1,-5.25
LOC01,Account 2,100811.57
LOC01,Account 3,13298.7299999999999942
LOC01,Account 4,17942.029999999999994
LOC01,Account 5,-12528.279999999999995
LOC01,Account 6,2048.9399999999999995
LOC01,Account 7,547.25
LOC01,Account 8,90295
LOC01,Account 9,-83
LOC01,Account 10,-340.11
LOC01,Account 11,-5619.3499999999999923
LOC01,Account 12,-780
LOC01,Account 13,-450
LOC01,Account 14,-98126.44
LOC01,Account 14
Account 15
Account 15
Account 16
Account 17
Account 17
Account 18,-540
LOC01, Account 14
Account 14
Account 14
Account 17
Account 14
Account 17,0
LOC01,Account 18,-869.95
LOC01,Account 19,-6100.01
LOC01,Account 20,-92849.6899999999999995
LOC01,Account 21,1150
LOC01,Account 22,-7801.4399999999999976
LOC02,Account 1,-4.25
一切看起来都很好,直到第15行。我们有相同的位置和帐户,没有数量,然后几行只有帐户,一些重复,大多数没有位置或金额,有些只缺少位置。
每个位置都会重复此模式。
可能是什么导致了这个?
因为您的两个记录在account
字段中包含多个值(由回车符分隔)。