Pitney Bowes MapInfo Professional User Manual

Page 252

Advertising
background image

SALES

MONTH

SALES_REP

1400

June

Cathy

600

June

Julie

1200

July

John

700

July

Cathy

1000

July

Julie

MapInfo Professional could also compute the total sales for each representative by specifying in the
SQL Select dialog box:

• Select Columns: SALES_REP, sum(SALES)

• Group by Columns: SALES_REP

sum(SALES)

SALES_REP

3300

John

3000

Cathy

2700

Julie

or MapInfo Professional could compute the average sales for each representative:

• Select Columns: SALES_REP, avg(SALES)

• Group by Columns: SALES_REP

avg(SALES)

SALES_REP

1100

John

1000

Cathy

900

Julie

or MapInfo Professional could compute the total sales for each month:

• Select Columns: MONTH, sum(SALES)

• Group by Columns: MONTH

sum(SALES)

MONTH

3200

May

2900

June

2900

July

MapInfo Professional has six aggregate functions:

Count(*): counts the number of records in a group. It takes * as its argument because it applies to the

record as a whole, and not to any particular field in the record.

Sum (expression): calculates the sum of the values in <expression> for all group records.

MapInfo Professional 12.5

252

Querying Your Data in MapInfo Professional

Advertising