How to select data from multiple tables

The syntax for a SELECT statement that joins two tables

      SELECT column-1 [, column-2] ... 
      FROM table-1 {
        INNER | LEFT OUTER | RIGHT OUTER
      } JOIN table-2 ON table-1.column-1 = table-2.column-2 
      [WHERE selection-criteria] 
      [ORDER BY column-1 [ASC|DESC] [, column-2 [ASC|DESC]] ...];
      

A statement that gets data from two related tables

      SELECT categoryName, productName, listPrice 
      FROM categories 
      INNER JOIN products 
      ON categories.categoryID = products.categoryID 
      WHERE listPrice > 800 
      ORDER BY listPrice ASC;
      

Description

Back