Previous Topic: Overview of JoinsNext Topic: SELECT Statement Select-Into Syntax


SELECT Statement Subselect Syntax

Following is the SELECT statement's complete subselect syntax with the JOIN syntax as a choice in the FROM clause:

►►─ SELECT ─┬────────────────┬────────────────────────────────────────────────►
            └─┬─ ALL ◄ ────┬─┘
              └─ DISTINCT ─┘

 ►─┬─ * ────────────────────────────────────────────┬─ FROM ──────────────────►
   │ ┌─ , ────────────────────────────────────────┐ │
   └─▼─┬─ expression ─┬───────────────────────┬─┬─┴─┘
       │              └─ AS ─ sql-identifier ─┘ │
       └─┬─ table-name.* ───────┬───────────────┘
         ├─ view-name.* ────────┤
         └─ correlation-name.* ─┘

   ┌─ , ─────────┐
 ►─▼─ table-ref ─┴─┬─────────────────────────┬────────────────────────────────►
                   └─ WHEREsearch-condition ─┘

 ►─┬──────────────────────────────┬─┬──────────────────────────┬──────────────►◄
   └─ GROUP BY ─▼─ column-name ─┴─┘ └─ HAVINGsearch-condition ─┘