This blog post will deal with how you carry out simple SQL queries in MapInfo. A further blog post will deal with more complex SQL queries.
Simple queries relating to attributes and spatial positioning are actually very straightforward as the functionality is present in the SELECT dialogue box, from the QUERY menu. The QUERY menu also has a SQL SELECT menu which allows you to carry out more complicated SQL queries.
It leads you through building a query in a very simple fashion. as follows:
1. Choose the table that contains the data that you want to make your selection from - this is the drop down menu next to the 'Select Records From Table' which is at the top of the box.
2. Enter the expression that will choose your data next to 'That Satisfy Either' in the second line of the table. If you are struggling to build the expression that you require you can always press the ASSIST button and that will launch the expression builder that will walk you through building an expression.
3. From the dropdown box you need to tell MapInfo where to store the results of your query. The dropdown is next to the 'Store Results in Table' title.
4. You need to choose how you would like the results of your search ordered. This you do at the dropdown menu next to the 'Sort Results By Column' title.
5. You can choose if you want the results of your query to be automatically opened in a new window. You do this by checking the box next to 'Browse Results'.
6. Finally there is a checkbox for 'Find Results In Current Map Window'. If you tick this checkbox then it will automatically adjust the scale of the map that is currently open so that it shows all of the features that have been selected by the query.
The next blog post will be on using the Expression Builder when you are creating a query in MapInfo. This is what was mentioned in point 2 and brings in some SQL.
Simple queries relating to attributes and spatial positioning are actually very straightforward as the functionality is present in the SELECT dialogue box, from the QUERY menu. The QUERY menu also has a SQL SELECT menu which allows you to carry out more complicated SQL queries.
It leads you through building a query in a very simple fashion. as follows:
1. Choose the table that contains the data that you want to make your selection from - this is the drop down menu next to the 'Select Records From Table' which is at the top of the box.
2. Enter the expression that will choose your data next to 'That Satisfy Either' in the second line of the table. If you are struggling to build the expression that you require you can always press the ASSIST button and that will launch the expression builder that will walk you through building an expression.
3. From the dropdown box you need to tell MapInfo where to store the results of your query. The dropdown is next to the 'Store Results in Table' title.
4. You need to choose how you would like the results of your search ordered. This you do at the dropdown menu next to the 'Sort Results By Column' title.
5. You can choose if you want the results of your query to be automatically opened in a new window. You do this by checking the box next to 'Browse Results'.
6. Finally there is a checkbox for 'Find Results In Current Map Window'. If you tick this checkbox then it will automatically adjust the scale of the map that is currently open so that it shows all of the features that have been selected by the query.
The next blog post will be on using the Expression Builder when you are creating a query in MapInfo. This is what was mentioned in point 2 and brings in some SQL.