outer join syntax

  • Thread starter Thread starter Guest
  • Start date Start date
Yes.

Syntax is of the form:

FROM table1 [ LEFT | RIGHT ] JOIN table2
ON table1.field1 <operator> table2.field2

LEFT or RIGHT identifies the table (by its position in the join expression)
for which all records will be returned, even if there are no matching
records in the other table.

For example (from the help), the following query joins the Categories and
Products tables on the CategoryID field. The query produces a list of all
categories, including those that contain no products:

SELECT
CategoryName,
ProductName
FROM
Categories
LEFT JOIN
Products
ON
Categories.CategoryID = Products.CategoryID;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top