Limiting the Width of the Display

As with any SELECT statement, the columns you name after the SELECT keyword are the columns you want the query results to display, in their desired order.

If you use SELECT *, the columns appear in their CREATE TABLE order. In a query to find the title or titles associated with sales order number 1, you might join the salesdetails table to titles on title_id. The SQL-92 version uses the JOIN keyword in the FROM clause and adds the ON clause for specifying the join columns.

SQLSQL
select *                              select *
from titles, salesdetails             from titles

										join salesdetails
where titles.title_id =               on titles
.title_id =
 salesdetails.title_id ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.