SQL Query Improvements - MapInfo_Pro - 2023

MapInfo Pro Help

Product type
Software
Portfolio
Locate
Product family
MapInfo
Product
MapInfo > MapInfo Pro
Version
2023
Language
English
Product name
MapInfo Pro
Title
MapInfo Pro Help
First publish date
1985
Last updated
2023-09-12
Published on
2023-09-12T16:39:16.995549

Cross Joins

The SQL Select statement now support cross joins, for example:

Select expression_list
From table_name [ , ... ] [Cross Join]
                [ Where expression_group ]
[ Into results_table [ Noselect ] [ Hide ] ]
[ Group By column_list ]
[ Order By column_list ]
In MapInfo Pro, the default SQL version is 1700. Therefore, cross join support is not available by default, and join conditions are evaluated from left to right. To allow cross joins, you must set the SQL version to 1900 using the MapBasic Set SQL Version statement. This would allow support for cross joins, and join conditions would be evaluated from right to left.
Note: If the SQL version is set to 1900, you can perform cross-joins with or without using the Cross Join keyword in the SQL Select statement. To allow cross-joins with SQL version 1700, use the Cross Join keyword explicitly in the SQL Select statement.

Joins between more than two Dynamic Query tables

You can now create joins between more than two dynamic query tables. Earlier, this was restricted to only joins between two dynamic query tables. For example,
Select * from ehitis where ehitis.systeem_kood = "1106800020020" AND ehitis.kood = "001" into query1
SELECT systeemi_eesvoolu_osa.id, systeemi_eesvoolu_osa.rajatis_id
FROM systeemi_eesvoolu_osa, rajatis, query1
WHERE systeemi_eesvoolu_osa.rajatis_id = rajatis.id
AND rajatis.ehitis_systeem_kood = query1.systeem_kood