Subject | RE: [firebird-support] SQL UNION ALL |
---|---|
Author | Louis Kleiman |
Post date | 2005-02-24T14:53:32Z |
A UNION can only have one ORDER BY (since it is just a single result set).
Remove the ORDER BY clause on the first select.
Louis Kleiman
SSTMS, Inc.
_____
From: Alberto Pesce [mailto:palberto@...]
Sent: Thursday, February 24, 2005 3:11 AM
To: firebird-support
Subject: [firebird-support] SQL UNION ALL
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
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=12968c8ad/M=298184.6018725.7038619.3001176/D=gr
oups/S=1705115386:HM/EXP=1109319088/A=2593423/R=0/SIG=11el9gslf/*http:/www.n
etflix.com/Default?mqso=60190075> click here
<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
:HM/A=2593423/rand=310890024>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
[Non-text portions of this message have been removed]
Remove the ORDER BY clause on the first select.
Louis Kleiman
SSTMS, Inc.
_____
From: Alberto Pesce [mailto:palberto@...]
Sent: Thursday, February 24, 2005 3:11 AM
To: firebird-support
Subject: [firebird-support] SQL UNION ALL
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
Yahoo! Groups Sponsor
ADVERTISEMENT
<http://us.ard.yahoo.com/SIG=12968c8ad/M=298184.6018725.7038619.3001176/D=gr
oups/S=1705115386:HM/EXP=1109319088/A=2593423/R=0/SIG=11el9gslf/*http:/www.n
etflix.com/Default?mqso=60190075> click here
<http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=groups/S=
:HM/A=2593423/rand=310890024>
_____
Yahoo! Groups Links
* To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/
* To unsubscribe from this group, send an email to:
firebird-support-unsubscribe@yahoogroups.com
<mailto:firebird-support-unsubscribe@yahoogroups.com?subject=Unsubscribe>
* Your use of Yahoo! Groups is subject to the Yahoo!
<http://docs.yahoo.com/info/terms/> Terms of Service.
[Non-text portions of this message have been removed]