Article ID: 142001
Article Last Modified on 5/7/2003
128388 : INF: Rushmore Query Optimization Paper Available on MSL
Select * From Authors Where Au_ID In (1, 3, 5, 7, 9)
Select * From Authors Where Au_ID Not In (1, 3, 5, 7, 9)
Select * From Publishers, Titles
To get a useful list of data, your data must have a common key field
(or set of fields) that relate the tables. You can retrieve data from your
tables by simply ensuring that these key fields match for each row you
retrieve:
Select * From Publishers, Titles
Where Publishers.PubID=Titles.PubID
However, this returns rows without recognizing the relationship between
the records in the separate tables, so the resulting RecordSet will not be
updatable. To return an updatable recordset, you need to join the tables as in
this example:
Select * From Publishers
Inner Join Titles On Publishers.PubID=Titles.PubID
For more information, please see the "Joins" topic in the Visual Basic
Help file and the following articles in the Microsoft Knowledge Base: 102681 : PRB: Error When Updating Fields in Dynaset That Has 2+ Tables
Additional query words: FAQ kbdse kbDSupport kbVBp kbVBp400 kbVBp500 kbVBp600 kbfaq
Keywords: kbinfo KB142001