Using sql select to query data – Pitney Bowes MapInfo Professional User Manual

Page 240

Advertising
background image

3. On the File menu, click Save Copy As and save the Selection table. The table can be saved with

any filename.

Using SQL Select to Query Data

A selection is a subset of data rows in a table, chosen based on the contents of one or more columns
from the table. You create selections by formulating questions, or queries, about your data. How many
customers live in the state of Idaho? Which police precinct has the highest rate of violent crime? MapInfo
Professional stores the results of these questions in temporary tables called query tables.

In the first part of this chapter, we discussed selections and query tables as a result of using Query Select
command. We now turn our attention to an extremely powerful and useful feature in MapInfo Professional,
querying by SQL Select.

While MapInfo Professional's Select command lets you formulate sophisticated queries, SQL Select
goes even further. The records in the query table generated by the Select command do not have any
information in them that is not contained in the records of the base table. They are, in fact, the same
records. They have been arranged so that they can be viewed together.

With SQL Select you can create query tables containing information that was only implicit in the base
table(s).

The SQL Select dialog box is one of the most elaborate ones in MapInfo Professional. But do not be
intimidated. Once you learn what each box is used for, it is fairly simple to create powerful selection
statements. You can type directly into the boxes or you can use the pop up menus on the right to enter
items into the boxes.

The easiest way to describe the dialog box is to walk you through an example, step-by-step. This example
uses data from the WORLD table included in MapInfo Professional, so you can try out this SQL Select
exercise yourself. We have included a brief description of the parts of the dialog box with each step. A
complete description of each box is given after the example.

MapInfo Professional 12.5

240

Querying Your Data in MapInfo Professional

Advertising