Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have two tables. Each table has a column with a reference number. Most of the records in these tables are the same but there are some which are in one table but not in the other.

How can I compare these columns and pick out the records which are only in one table?

I could write a MapBasic program that loops through each record and looks it up in the other table but I'm wondering if there is a simpler SQL-like way of doing this.

share|improve this question
up vote 5 down vote accepted

Let's say we have two tables: Tab1 with field Field1, Tab2 with field Field2.

We want to select records from Tab1 which Field1 values is not present in Field2 of Tab2.

In MapInfo: menu Query->SQL Select...

  • Columns: *
  • from Tables: Tab1
  • where Condition: not Field1 in (select Field2 from Tab2)

In MapBasic window it will be: Select * from Tab1 where not Field1 in (select Field2 from Tab2) into Selection

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.