我正在使用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行之前,一切看起来都很不错。这里有相同的位置和帐户,没有金额,然后有几行只有帐户,有些重复了,大部分没有位置或金额,有的只是位置缺失。
此模式在每个位置重复。
可能是什么原因造成的?
答案 0 :(得分:1)
因为您的两个记录在account
字段中包含多个值(用回车分隔)。