Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL Select w/ Union
Message
 
 
To
06/05/1999 16:44:26
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00215861
Message ID:
00215865
Views:
27
>Hi all,
>
>Trying to join two cursors so that the result is one cursor with all the records for both. This is the easiest type of union, but I simply cannot remember how it works. What I am doing is resulting in no records selected -- so that's wrong.
>
>SELECT ;
>    FField1 AS Field1, ;
>    FField2 AS Field2  ;
>    FROM myTable1      ;
 <b>union</b>
>SELECT ;
>    BField1 AS Field1, ;
>    BField2 AS Field2  ;
>    FROM myTable2      ;
>INTO CURSOR myCursor2 NOFILTER
>
What is the syntax to merge myCursor1 and myCursor2 such that all records in both cursors are included in the merged table?
>
>Thanks for your help.
>
>regards,

you left out the union and field1 and field 2 have to be the same data types in both selects. Any Order by, Group by and into cursor clauses have to be issued once and must be at the end of the last select.
Mark McCasland
Midlothian, TX USA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform