Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ORDER by in a UNION
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00255458
Message ID:
00255466
Views:
19
>Hi,
> I'm trying to execute the following command using VFP 5.0a:
>
>SELECT field1, ... FROM table 1 UNION SELECT field2,.. FROM table 2 ORDER BY fieldname.
>
>I get an error which states 'Invalid ORDER BY clause.' However, when I reference the column by number, e.g. ORDER BY 3, it orders the result table by the third column. Is there any way to reference the order by clause with a fieldname?
>
>TIA

Not with a UNION select. You must use the column id # to reference it.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Reply
Map
View

Click here to load this message in the networking platform