Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
UNION and order
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00212225
Message ID:
00212227
Views:
23
Mark,

If you just want all the table 1 records, then table 2, then table 3 and don't care what order they're in within each table, you can do this:
SELECT '1',* FROM table1 ;
UNION ;
SELECT '2',* FROM table2 ;
UNION ;
SELECT '3', * FROM table3 ;
   ORDER BY 1
You can also make this work if you have other columns that you can use to sort the data within each table.

>I'd like to combine 3 tables using UNION. But I dont need any order, I'd like to keep records in order they come from tables:
>table1, table2, table3.
>Is it possible?
>Thanks Mark
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform