From fd33f237d27745ea307a22c35713547e35907580 Mon Sep 17 00:00:00 2001 From: asfernandes Date: Thu, 3 May 2007 01:32:08 +0000 Subject: [PATCH] Doc. for new join types --- doc/sql.extensions/README.joins.txt | 38 +++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 doc/sql.extensions/README.joins.txt diff --git a/doc/sql.extensions/README.joins.txt b/doc/sql.extensions/README.joins.txt new file mode 100644 index 0000000000..95d1e4d412 --- /dev/null +++ b/doc/sql.extensions/README.joins.txt @@ -0,0 +1,38 @@ +-------------- +New JOIN types +-------------- + +Author: + Adriano dos Santos Fernandes + +Format: + ::= + JOIN
USING ( ) + + ::= +
NATURAL JOIN
+ +Notes: + Named columns join: + 1) All columns specified in should exist in the tables of both sides. + 2) An equi-join (. = .) is automatically + created for all columns (ANDed). + 3) The USING columns can be accessed without qualifier, and in this case, result of + it is COALESCE(., .). + 4) In "SELECT *", USING columns are expanded once, using the above rule. + + Natural join: + 1) A "named columns join" is automatically created with all columns common to the + left and right tables. + 2) If the is no common column, a CROSS JOIN is created. + +Examples: + 1) select * + from employee + join department + using (dept_no); + + 2) select * + from employee_project + natural join employee + natural join project;