这是一个 MyODBC 错误,请参见此处的官方条目。直到今天,它仍然开放...
[编辑] 我找到了一个简单的解决方案:myODBC 只会理解带有 ONE UNION
(或UNION ALL
)的查询。UNION
所以你必须用 with包裹右边的部分()
。另外,您需要以 结束每个查询;
,如下所示:
SELECT [Ordine numero] AS ordine, [data ordine] AS data, comm AS commessa
FROM [archivio globale]
WHERE [ordine numero] IS NOT NULL;
UNION ALL (
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [ricambi]
WHERE [numero ordine cliente] IS NOT NULL;
UNION ALL
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [trasferte]
WHERE [numero ordine cliente] IS NOT NULL
);
当然,您也必须对这部分应用相同的方法。例如,如果您UNION ALL
在查询中还需要一个:
SELECT [Ordine numero] AS ordine, [data ordine] AS data, comm AS commessa
FROM [archivio globale]
WHERE [ordine numero] IS NOT NULL;
UNION ALL (
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [ricambi]
WHERE [numero ordine cliente] IS NOT NULL;
UNION ALL (
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [trasferte]
WHERE [numero ordine cliente] IS NOT NULL;
UNION ALL
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [xxx]
WHERE [numero ordine cliente] IS NOT NULL
));