Keywords: oj (JDBC escape keyword), {oj (JDBC escape syntax), Outer joins, JDBC escape syntax for

# 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 JOIN operations [JOIN operations ]* }

#### Equivalent to

    JOIN operations [JOIN operations ]*

    -- 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 joinOperation. 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
JDBC escape syntax for LIKE 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