|
-
Jul 18th, 1999, 11:57 AM
#1
Thread Starter
Member
Hi,
I have a problem in writing my query which extracts some records from a table which are (the records) not existing in another table.
E.g.: I have the following tables:
'Table1' with one field 'Index'
'Table2' with one field 'Index'
Table1.Index Table2.Index
------------ ------------
3 4
2 5
0 12
1 17
22 0
13 1
my question is how to write a query that compares all records in Table1.Index with all records in Table2.Index and extracts all those which are not matching each other. In above example the result should be:
3
2
22
13
.. my suggestion was:
SqlCommand='SELECT DISTINCTROW [Table1].Index
FROM [Table1] INNER JOIN [Table2] ON [Table1].Index <> [Table2].Index'
.. but it doesn't work, however, if change the criterion to select the opposite set it works fine !!
SqlCommand='SELECT DISTINCTROW [Table1].Index
FROM [Table1] INNER JOIN [Table2] ON [Table1].Index = [Table2].Index'
.. could you help me please
I appreciate your assistance
Wesam
------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|