Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Combining of two tables
Message
 
 
To
26/11/2001 11:49:28
Michael Harris
Harris and Harris Consultants
Temple Hills, Maryland, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00585785
Message ID:
00585806
Views:
15
>I need to combine table A with table B into table C. Both tables have the following fields in common: Year, Borrower, Period, Rownum, and exchange(which is named "e" in table A and "en" in table B). The trick is I have to match records from table A with table B into each record in table C and I also have to include the records in both tables that do not match. Can I do this with one SQL command? If anyone can help me, thanks in advance.
>
I don't know how you define 'match' between tableA and tableB, but following select will consider records matching if all fields match.
SELECT Year, Borrower, Period, Rownum, e AS exchange ;
  FROM tableA ;
UNION ;
SELECT Year, Borrower, Period, Rownum, en AS exchange ;
  FROM tableB ;
INTO CURSOR crsResult 
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform