The multiple UNION query:
SELECT [Ordine numero] AS ordine, [data ordine] AS data, comm AS commessa
FROM [archivio globale]
WHERE [ordine numero] IS NOT NULL
UNION
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [ricambi]
WHERE [numero ordine cliente] IS NOT NULL
UNION
SELECT [numero ordine cliente] AS ordine, [data ordine cliente] AS data, numero AS commessa
FROM [trasferte]
WHERE [numero ordine cliente] IS NOT NULL
ORDER BY [ordine];
It doesn't work: I get the error message:
[mysql][odbc 5.1 Driver][mysqld-5.5.14]You have an error in your SQL syntax ...
While the single UNION query works properly (without the second UNION statement)? What to do?
See Question&Answers more detail:os