我有一个表创建查询(combine2),它接受一个查询(组合)并使其成为一个表(linegraph)。此表必须反映关联查询中的更改。目前,我已经指定了一个宏来运行追加查询以反映更改。
问题在于,无论append query
如何被调用,有时但不总是复制所有数据。有时它不会导入前100行左右。如何获得始终与我的查询匹配的更新表?
追加查询:Combine2
INSERT INTO linegraph SELECT * FROM Combine;
查询转为表:合并
SELECT * FROM Month1calc UNION
SELECT * FROM Month2calc UNION
SELECT * FROM month3calc UNION
SELECT * FROM Month4calc UNION
SELECT * FROM Month5calc UNION
SELECT * FROM Month6calc UNION
SELECT * FROM Month7calc UNION
SELECT * FROM Month8calc UNION
SELECT * FROM Month9calc UNION
SELECT * FROM Month10calc UNION
SELECT * FROM Month11calc UNION
SELECT * FROM Month12calc UNION
SELECT * FROM Month13calc UNION
SELECT * FROM Month14calc UNION
SELECT * FROM Month15calc UNION
SELECT * FROM Month16calc UNION
SELECT * FROM Month17calc UNION
SELECT * FROM Month18calc;
`
答案 0 :(得分:1)
尝试将UNION
更改为UNION ALL
。
当您使用UNION
时,查询仅返回唯一行(即:删除重复项)。使用UNION ALL
时,不会删除重复项。