ON clause: Join syntax

Specifies a join condition for data sources joined with a JOIN keyword.

Syntax

ON inner_condition | source.column = source.column [AND ...]
Components

inner_condition

A Boolean expression.

source

The name or alias of a data source.

column

The name of a column.

Usage

This form of the ON clause is required with outer joins, but is optional with inner joins specified with the JOIN keyword syntax. The ON clause defines a condition for the join.

All column references in the ON clause must refer to data sources specified in the FROM clause. This form of the ON clause is used in a Query statement, Database statement, or Remote Procedure statement.

Restrictions

See Also

Example

The following example publishes information about the symbol and price of a stock when an inquiry for the stock arrives on the Inquiry stream:

INSERT INTO OutStream
SELECT Trades.Symbol, Trades.Price
FROM Inquiry JOIN Trades
ON Inquiry.Symbol = Trades.Symbol;