Subject | SQL UNION ALL |
---|---|
Author | Alberto Pesce |
Post date | 2005-02-24T08:11:18Z |
Hi all,
why this union don't work:
SELECT SUM(A), B, C, D
FROM X,T,Z
WHERE set_condition_1
GROUP BY B, C, D, A
ORDER BY B
UNION ALL
SELECT SUM(A), B, C, D
FROM X,T,Z
WHERE set_condition_2
GROUP BY B, C, D, A
ORDER BY B
The queries above (separated) work fine but if I use the statemant union I obtain a SQL error.
thanks a lot
bye
Alberto
____________________________________________________________
Navighi a 2 MEGA e i primi 3 mesi sono GRATIS.
Scegli Libero Adsl Flat senza limiti su http://www.libero.it
why this union don't work:
SELECT SUM(A), B, C, D
FROM X,T,Z
WHERE set_condition_1
GROUP BY B, C, D, A
ORDER BY B
UNION ALL
SELECT SUM(A), B, C, D
FROM X,T,Z
WHERE set_condition_2
GROUP BY B, C, D, A
ORDER BY B
The queries above (separated) work fine but if I use the statemant union I obtain a SQL error.
thanks a lot
bye
Alberto
____________________________________________________________
Navighi a 2 MEGA e i primi 3 mesi sono GRATIS.
Scegli Libero Adsl Flat senza limiti su http://www.libero.it