# JDBC escape syntax for outer joins

Derby interprets the JDBC escape syntax for outer joins (and all join operations) as equivalent to the correct SQL syntax for outer joins or the appropriate join operation.

For information about join operations, see JOIN operations.

## Syntax

    { oj joinOperation [ joinOperation ]* }

## Equivalent to

    joinOperation [ joinOperation ]*

## Examples

    -- outer join
    SELECT *
    FROM
    {oj Countries LEFT OUTER JOIN Cities ON
       (Countries.country_ISO_code=Cities.country_ISO_code)}
    -- another join operation
    SELECT *
    FROM
    {oj Countries JOIN Cities ON (Countries.country_ISO_code=Cities.country_ISO_code)}
    -- a tableExpression can be a join operation. Therefore
    -- you can have multiple join operations in a FROM clause
    SELECT E.EMPNO, E.LASTNAME, M.EMPNO, M.LASTNAME
    FROM {oj EMPLOYEE E INNER JOIN DEPARTMENT
    INNER JOIN EMPLOYEE M ON MGRNO = M.EMPNO ON E.WORKDEPT = DEPTNO};

Parent topic: JDBC escape syntax
Related reference
JDBC escape keyword for call statements
JDBC escape syntax for LIKE clauses
JDBC escape syntax for limit/offset clauses
JDBC escape syntax for fn keyword
JDBC escape syntax for time formats
JDBC escape syntax for date formats
JDBC escape syntax for timestamp formats