Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
2 tables, Same records, How seek with SELECT?
Message
From
11/11/1997 12:22:58
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00059325
Message ID:
00059542
Views:
31
>>>How know which records are (aren't) in another table?
>>>Using SELECT query?
>>>And when you need more than one criteria?
>>
>>First, let me make sure that I understood your question correctly. I assume that you have two almost identical tables and you want to retrieve records from table1 which are missed in table2. If it's really so, you run following query:
>>Select * from Table1 ;
>>Where Table1.Primarykey NOT IN (Select PrimaryKey From Table2)
>Yes, I understand your point.
>But, what I have to do, when I haven't absolutely identical tables?
>And what is worse I haven't one Key.
>I must seek in one table from another one by 3 or more related keys.
>
>And query:
>Select * from Table1 ;
>where Table1.Key1+Table1.Key2+Table1.Key3 NOT IN ;
>(Select Table2.Key1+Table2.Key2+Table2.Key3 From Table2)
>is notsatisfactory for me.
>Do you understand me?

At the beginning you have are (aren't). Does that mean you
need both the ones that are and aren't part of the table. If
this is the case, you need to use an outer join. Erik Pikman
will be able to give you a good example of an outer join.

HTH

Dan
Previous
Reply
Map
View

Click here to load this message in the networking platform