Selecting Records from One Table that are Not in Another - MapInfo_Pro - 2023

MapInfo Pro Help

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
Version
2023
ft:locale
en-US
Product name
MapInfo Pro
ft:title
MapInfo Pro Help
First publish date
1985
ft:lastEdition
2023-09-12
ft:lastPublication
2023-09-12T16:39:16.995000

The following SQL statement allows you to select records from one table that are not in another table based on a field common to both tables. For example, if you have a table, STATE1 and want to select all of the records from STATE1 that are not in CITY125.

  1. On the MAP tab, click SQL Select.
    • Select Columns: *
    • from Tables: STATE1
    • where Condition: Not state In (Select state From CITY125)
    • into Table Named: Selection
    Note: The statement syntax is as follows: NOT columnname IN (SELECT columnname FROM secondtable)
  2. This SQL statement produces a query of all records in the table STATE1.TAB that do not exist in CITY125.TAB.