![Avaya Call Management System Скачать руководство пользователя страница 151](http://html1.mh-extra.com/html/avaya/call-management-system/call-management-system_custom-reports_3028118151.webp)
Selecting rows from more than one table
Issue 3.0 May 2002
151
Selecting rows from more than one table
For historical reports only, you can merge data from two tables into a single report field.
You can, for example, take the number of ACD calls a single agent handled (where data is
taken from the
dagent
table) and divide by the total ACD calls handled by the agent’s
split (where data is taken from the
dsplit
table). Or, you can take the ACD calls a split
handled in an intrahour interval (where data is taken from the
hsplit
table) and divide
by the total ACD calls the split handled for the day (where data is taken from the
dsplit
table).
To merge data from two tables into a single report field:
●
The two tables must have at least one database item in common. Typically, the
database items in common are indexes.
●
Both table names must be entered in the
Table
field of the Row Search ID assigned
to the field.
●
For custom historical reports you can use data from more than one table and use the
same row search ID for multiple tables.
●
At least one “join” clause must be included in the Row Search ID assigned to the field. A
“join” clause searches for the same value for the same item in both tables. In this way,
the data extracted from the rows in both tables will be related.
A “join” clause has the following format:
tablename1.item1 = tablename2.item1
where
item1
is a database item that the tables have in common.
●
You must prepend the table name to each database item included in the
Select rows
where:
statement. This rule applies to all database items, even those that are not in a
"join" clause.
●
A "join" clause must use a database item that is also included with a regular “where”
clause (one that directly assigns a value or variable name to the database item).
Note:
The syntax of a join clause is similar to that in standard INFORMIX SQL
syntax. See the INFORMIX-SQL Relational Database Management System
User Guide for INFORMIX SQL.