Views used with outer joins  Correlation name and column referencing rules for ANSI joins

Chapter 4: Joins: Retrieving Data from Several Tables

ANSI inner and outer joins

This is the ANSI syntax for joining tables:

left_table [inner | left [outer] | right [outer]] join right_table 
on left_column_name  = right_column_name

The result of the join between the left and the right tables is called a joined table. Joined tables are defined in the from clause. For example:

select titles.title_id, title, ord_num, qty
from titles left join salesdetail
on titles.title_id = salesdetail.title_id
title_id title              ord_num                qty
----------------------------- -------------------- -----
BU1032  The Busy Executive   AX-532-FED-452-2Z7   200
BU1032  The Busy Executive   NF-123-ADS-642-9G3   1000
. . .
TC7777  Sushi, Anyone?       ZD-123-DFG-752-9G8   1500
TC7777  Sushi, Anyone?       XS-135-DER-432-8J2   1090
(118 rows affected)

ANSI join syntax allows you to write either:

Sybase ANSI join syntax does not support the using clause.





Copyright © 2005. Sybase Inc. All rights reserved. Correlation name and column referencing rules for ANSI joins

View this book as PDF