SQL/MP Reference Manual
HP NonStop SQL/MP Reference Manual—523352-013
C-129
Correlation Names
A correlation name can be explicit or implicit.
An explicit correlation name is an SQL identifier associated with a table or view in the
FROM clause of a SELECT statement, in the select-statement of an INSERT
statement, or in a subquery. The name must be unique within the FROM clause.
An explicit correlation name is known only to the statement in which you define it. You
can use the same identifier as a correlation name in another statement.
A table or view reference that has no explicit correlation name has an implicit
correlation name. The implicit correlation name is the table or view name without the
optional subvolume, volume, and node qualifiers, or—if the reference to the table or
view is a DEFINE—the portion of the DEFINE name that follows the equals sign (=).
You cannot use an implicit correlation name for a reference that has an explicit
correlation name within the statement.
This example shows the uses of both explicit and implicit correlation names. The query
refers to two tables (ORDERS and CUSTOMER) that contain columns named
CUSTNUM. In the WHERE clause, one column reference is qualified by an implicit
correlation name (ORDERS) and the other by an explicit correlation name (X):
SELECT ORDERNUM, CUSTNAME FROM ORDERS, CUSTOMER X
WHERE ORDERS.CUSTNUM = X.CUSTNUM and ORDERS.CUSTNUM = 543;