Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Table comparison process assistance...
Message
From
11/11/2002 15:04:04
N. Lea
Nic Cross Enterprises
Valencia, California, United States
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00721202
Message ID:
00721223
Views:
9
Is there anyway to also bring over the names that matched too?

>The following select will return all records from table A that don't have matching first_name + last_name in the table B.
SELECT * FROM tableA ;
>  WHERE first_name + last_name NOT IN ( ;
>    SELECT first_name + last_name FROM tableB) ;
>  INTO CURSOR crsA READWRITE
After that you can assign new ID #'s in the cursor and append records to the table B.
>
>>could anyone be kind enough to help me with a process that I am working on?
>>
>>I have three tables (which may not be the best method).
>>
>>Table A - Has a list of 160 names (id_no, first_name, last_name) Id Sequence is 1000 thru 1160
>>
>>Table B - Has a list of 6000 names (id_no, first_name, last_name) Id sequence is 1000 thru 6000
>>
>>Table C - Empty (id_no, first_name, last_name)
>>
>>I need to get the names from Table A to Table B. The first thing I do is scan Table A against the Table B to seek out duplicates. The process that I use is to assign the first and last name to variables. Then I go to scan for those variables in Table B. Of course I get screwed up results.
>>
>>The reason I just do not append from Table A to B is because the id sequences are identical and I do not wish to duplicate the data. So I get the last number used and will assign sequential numbers to the unmatched names.
>>
>>Overall, I will be doing this to three other tables of the same structures except one table is for addresses and one is for account numbers.
>>
>>Confused yet? I know that I am....thanks for any help.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform