In this presentation, you will get an overview over some of the improvements to the SQL syntax in MapInfo Pro v2019.
There are also a few examples of how to benefit from these improvements
2. This presentation will give you an
overview over some of the
improvements to the SQL syntax in
MapInfo Pro v2019
2
MapInfo Pro v2019
3. The syntax & functionality
• Table Alias:
Select a.Name
From Addresses As "a"
• Column Alias:
Select a.Name As "OtherName"
From Addresses As a
• All columns from a specific table
Select a.*, Area(Overlap(a.obj, z.obj), "sq m")
From PopAreas As "a", Zones As "z"
Where a.obj Intersects z.obj
3
MapInfo Pro v2019
4. The syntax & functionality
• MapBasic Function Defines:
Select ObjectInfo(Obj, OBJ_INFO_NPNTS) As "Nodes"
From PopAreas
• Spatial Aggregations
Select Type, Count(*) "NumRecords", AggregateUnion(OBJ)
From PopAreas
Group By Type
• Specifying which object to use:
Select Addresses.*, CartesianBuffer(obj, 24, 250, "m") object
From Addresses
4
MapInfo Pro v2019
5. The syntax & functionality
• Limit clause
Select *
From Countries
Where Pop_1994 > 2000000
And Pop_1994 < 3000000
Limit 5
• Cross Joins
Select Addresses.*, ObjectDistance(a.obj, z.obj, "m")
From Addresses As "a", Zones As "z"
Where ObjectDistance(a.obj, z.obj, "m") < 200
5
MapInfo Pro v2019
6. The syntax & functionality
• Where clause for Delete:
Delete From PopAreas
Where Not OBJ
• Where clause for Update
Update PopAreas
Set Area_sqm = Area(obj, "sq m")
Where Area_sqm = 0
6
MapInfo Pro v2019
7. MapBasic Scripts
• The SQL Window supports multiple
statements
• Save as Favorite and Run from the SQL
Dropdown
7
MapInfo Pro v2019
8. Virtual Spatial Object
• You can now show the calculated spatial
objects in a map
• Use the Object keyword if a query returns
multiple spatial objects
8
MapInfo Pro v2019
9. MapBasic Defines
• You can now use MapBasic defines instead
of the numeric codes in your queries
• It makes them easier to read.
• Here we are getting the name of the table
the selection is based on
9
MapInfo Pro v2019
10. Cross Joins andTemporaryTables
• Join tables where objects don't touch
• Use temporary tables/queries in joins
• Use multiple queries via the SQL Window
10
MapInfo Pro v2019
11. Update using the SQLWindow
• Supports updating objects
• Supports where expression
11
MapInfo Pro v2019
12. Select by Location
• Build spatial joins via easy to use dialog
• Support all spatial operators and Within a distance
• Resulting query can afterwards be loaded into the
SQL Window
12
MapInfo Pro v2019