Article ID: 110906 - Last Review: March 18, 2005 - Revision: 3.1 You receive an error message when you run an SQL SELECT statement that has a UNION clause and an ORDER BY clause
This article was previously published under Q110906 SYMPTOMS
When you run an SQL SELECT statement that has a UNION clause and an
ORDER BY clause, you may receive the following error message if
the ORDER BY clause references a field name: SQL Invalid ORDER BY SQL: Order by Clause is Invalid CAUSE
This error message is the correct response according to page L3-872 of the
"Language Reference."
RESOLUTION
To resolve this problem, replace the ORDER BY character expression clause
with an ORDER BY numeric expression clause. In the ORDER BY numeric expression clause, the numeric expression
indicates the number of the column to order the output by. Only the
final SQL SELECT statement can have an ORDER BY clause.
The following example shows the correct syntax. | Other Resources Other Support Sites
CommunityGet Help NowArticle Translations |






Windows Live
Facebook
Twitter
Linkedin
Digg it
Yahoo
Delicious
StumbleUpon
Yammer
Reddit
Technorati
FriendFeed
Email
Back to the top
