db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fuzzylo...@apache.org
Subject svn commit: r379913 - in /db/derby/docs/trunk/src/ref: rrefsqlj18922.dita rrefsqlj57522.dita
Date Wed, 22 Feb 2006 21:21:42 GMT
Author: fuzzylogic
Date: Wed Feb 22 13:21:41 2006
New Revision: 379913

URL: http://svn.apache.org/viewcvs?rev=379913&view=rev
Log:
DERBY-994: Improve examples for LEFT OUTER JOIN and RIGHT OUTER JOIN in the
reference manual.

Committed for Jeff Levitt <derby@mylevita.com>

Modified:
    db/derby/docs/trunk/src/ref/rrefsqlj18922.dita
    db/derby/docs/trunk/src/ref/rrefsqlj57522.dita

Modified: db/derby/docs/trunk/src/ref/rrefsqlj18922.dita
URL: http://svn.apache.org/viewcvs/db/derby/docs/trunk/src/ref/rrefsqlj18922.dita?rev=379913&r1=379912&r2=379913&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj18922.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj18922.dita Wed Feb 22 13:21:41 2006
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "reference.dtd">
 <!-- 
 Copyright 1997, 2005 The Apache Software Foundation or its licensors, as applicable.  
 
@@ -14,57 +16,61 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-
-<!DOCTYPE reference PUBLIC "-//IBM//DTD DITA Reference//EN"
- "../dtd/reference.dtd">
 <reference id="rrefsqlj18922" xml:lang="en-us">
 <title>LEFT OUTER JOIN</title>
 <prolog><metadata>
 <keywords><indexterm>LEFT OUTER JOIN expression</indexterm></keywords>
 </metadata></prolog>
 <refbody>
-<section> <p>A LEFT OUTER JOIN is one of the <xref href="rrefsqlj29840.dita#rrefsqlj29840">JOIN
operations</xref>s
-that allow you to specify a join clause. It preserves the unmatched rows from
-the first (left) table, joining them with a NULL row in the shape of the second
-(right) table.</p></section>
-<refsyn><title>Syntax</title> <codeblock><b><i><xref
href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
LEFT [ OUTER ] JOIN <i
+<section> <p>A LEFT OUTER JOIN is one of the <xref href="rrefsqlj29840.dita#rrefsqlj29840">JOIN
+operations</xref>s that allow you to specify a join clause. It preserves the
+unmatched rows from the first (left) table, joining them with a NULL row in
+the shape of the second (right) table.</p></section>
+<refsyn><title>Syntax</title><codeblock><b><i><xref
href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
LEFT [ OUTER ] JOIN <i
 ><xref href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
 {
     ON <i>booleanExpression</i> 
-    }</b></codeblock> <p>The scope of expressions in either the ON clause
-includes the current tables and any tables in query blocks outer to the current
-SELECT.  The ON clause can reference tables not being joined and does not
-have to reference either of the tables being joined (though typically it does). </p>
</refsyn>
-<example> <codeblock><b><ph>--match cities to countries</ph>
-SELECT CITIES.COUNTRY, REGION 
+    }</b></codeblock><p>The scope of expressions in either the ON clause
includes
+the current tables and any tables in query blocks outer to the current SELECT.
+ The ON clause can reference tables not being joined and does not have to
+reference either of the tables being joined (though typically it does).</p> </refsyn>
+<example><title>Example 1</title><codeblock><b>--match cities
to countries in Asia</b>
+
+SELECT CITIES.COUNTRY, CITIES.CITY_NAME, REGION 
 FROM Countries 
 LEFT OUTER JOIN Cities
-ON CITY_ID=CITY_ID
+ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE
 WHERE REGION = 'Asia';
-<ph>-- use the synonymous syntax, RIGHT JOIN, to achieve exactly 
--- the same results as in the example above</ph>
 
-SELECT COUNTRIES.COUNTRY, REGION 
-FROM Countries 
-LEFT JOIN Cities
-ON CITY_ID=CITY_ID;
-<ph>-- Join the EMPLOYEE and DEPARTMENT tables, 
+<b>-- use the synonymous syntax, LEFT JOIN, to achieve exactly 
+-- the same results as in the example above
+</b>
+SELECT  COUNTRIES.COUNTRY, CITIES.CITY_NAME,REGION 
+FROM COUNTRIES 
+LEFT JOIN CITIES 
+ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE
+WHERE REGION = 'Asia';
+</codeblock></example>
+<example><title>Example 2</title><codeblock><b>
+-- Join the EMPLOYEE and DEPARTMENT tables, 
 -- select the employee number (EMPNO), 
 -- employee surname (LASTNAME), 
 -- department number (WORKDEPT in the EMPLOYEE table
 -- and DEPTNO in the DEPARTMENT table) 
 -- and department name (DEPTNAME) 
--- of all employees who were born (BIRTHDATE) earlier than 1930</ph>
+-- of all employees who were born (BIRTHDATE) earlier than 1930
+</b>
 SELECT EMPNO, LASTNAME, WORKDEPT, DEPTNAME 
    FROM SAMP.EMPLOYEE LEFT OUTER JOIN SAMP.DEPARTMENT 
    ON WORKDEPT = DEPTNO 
    AND YEAR(BIRTHDATE) &lt; 1930;
-<ph>-- List every department with the employee number and 
+
+<b>-- List every department with the employee number and 
 -- last name of the manager,
--- including departments without a manager</ph>
+-- including departments without a manager
+</b>
 SELECT DEPTNO, DEPTNAME, EMPNO, LASTNAME
       FROM DEPARTMENT LEFT OUTER JOIN EMPLOYEE
-	    ON MGRNO = EMPNO;</b></codeblock> </example>
+	    ON MGRNO = EMPNO;</codeblock> </example>
 </refbody>
 </reference>
-

Modified: db/derby/docs/trunk/src/ref/rrefsqlj57522.dita
URL: http://svn.apache.org/viewcvs/db/derby/docs/trunk/src/ref/rrefsqlj57522.dita?rev=379913&r1=379912&r2=379913&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqlj57522.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqlj57522.dita Wed Feb 22 13:21:41 2006
@@ -1,4 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "reference.dtd">
 <!-- 
 Copyright 1997, 2005 The Apache Software Foundation or its licensors, as applicable.  
 
@@ -14,54 +16,60 @@
 See the License for the specific language governing permissions and  
 limitations under the License.
 -->
-
-<!DOCTYPE reference PUBLIC "-//IBM//DTD DITA Reference//EN"
- "../dtd/reference.dtd">
 <reference id="rrefsqlj57522" xml:lang="en-us">
 <title>RIGHT OUTER JOIN</title>
 <prolog><metadata>
 <keywords><indexterm>RIGHT OUTER JOIN expression</indexterm></keywords>
 </metadata></prolog>
 <refbody>
-<section> <p>A RIGHT OUTER JOIN is one of the <xref href="rrefsqlj29840.dita#rrefsqlj29840">JOIN
operations</xref>s
-that allow you to specify a JOIN clause. It preserves the unmatched rows from
-the second (right) table, joining them with a NULL in the shape of the first
-(left) table. A LEFT OUTER JOIN B is equivalent to B RIGHT OUTER JOIN A, with
-the columns in a different order.</p></section>
-<refsyn><title>Syntax</title> <codeblock><b><i><xref
href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
RIGHT [ OUTER ] JOIN <i
+<section> <p>A RIGHT OUTER JOIN is one of the <xref href="rrefsqlj29840.dita#rrefsqlj29840">JOIN
+operations</xref>s that allow you to specify a JOIN clause. It preserves the
+unmatched rows from the second (right) table, joining them with a NULL in
+the shape of the first (left) table. A LEFT OUTER JOIN B is equivalent to
+B RIGHT OUTER JOIN A, with the columns in a different order.</p></section>
+<refsyn><title>Syntax</title><codeblock><b><i><xref
href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
RIGHT [ OUTER ] JOIN <i
 ><xref href="rreftableexpression.dita#rreftableexpression">TableExpression</xref></i>
 {
     ON <i>booleanExpression</i> 
-    }</b></codeblock> <p>The scope of expressions in the ON clause includes
+    }</b></codeblock><p>The scope of expressions in the ON clause includes
 the current tables and any tables in query blocks outer to the current SELECT.
  The ON clause can reference tables not being joined and does not have to
 reference either of the tables being joined (though typically it does).</p> </refsyn>
-<example> <codeblock><b><ph>-- get all countries and corresponding
cities, including
--- countries without any cities</ph>
-SELECT CITY_NAME, CITIES.COUNTRY
-FROM CITIES RIGHT OUTER JOIN COUNTRIES
-ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE;
-<ph>-- get all countries in Africa and corresponding cities, including
--- countries without any cities</ph>
-SELECT CITY_NAME, CITIES.COUNTRY
-FROM CITIES RIGHT OUTER JOIN COUNTRIES
+<example> <title>Example 1</title><codeblock><b>-- get all
countries and corresponding cities, including
+-- countries without any cities</b>
+
+SELECT COUNTRIES.COUNTRY, CITIES.CITY_NAME 
+FROM CITIES 
+RIGHT OUTER JOIN COUNTRIES 
 ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE;
-WHERE Countries.region = 'frica';
-<ph>-- use the synonymous syntax, RIGHT JOIN, to achieve exactly
--- the same results as in the example above</ph>
-SELECT CITY_NAME, CITIES.COUNTRY
-FROM CITIES RIGHT JOIN COUNTRIES
+
+<b>-- get all countries in Africa and corresponding cities, including
+-- countries without any cities
+</b>
+SELECT COUNTRIES.COUNTRY, CITIES.CITY_NAME
+FROM CITIES 
+RIGHT OUTER JOIN COUNTRIES 
 ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE
 WHERE Countries.region = 'Africa';
-<ph>-- a TableExpression can be a joinOperation. Therefore
--- you can have multiple join operations in a FROM clause</ph>
+
+<b>-- use the synonymous syntax, RIGHT JOIN, to achieve exactly
+-- the same results as in the example above
+</b>
+SELECT COUNTRIES.COUNTRY, CITIES.CITY_NAME
+FROM CITIES 
+RIGHT JOIN COUNTRIES 
+ON CITIES.COUNTRY_ISO_CODE = COUNTRIES.COUNTRY_ISO_CODE
+WHERE Countries.region = 'Africa';
+</codeblock> </example>
+<example><title>Example 2</title><codeblock><b>-- a TableExpression
can be a joinOperation. Therefore
+-- you can have multiple join operations in a FROM clause
 -- List every employee number and last name 
 -- with the employee number and last name of their manager
+</b>
 SELECT E.EMPNO, E.LASTNAME, M.EMPNO, M.LASTNAME	
 	FROM EMPLOYEE E RIGHT OUTER JOIN	
 	DEPARTMENT RIGHT OUTER JOIN EMPLOYEE M 
         ON MGRNO = M.EMPNO
-        ON E.WORKDEPT = DEPTNO;</b></codeblock> </example>
+        ON E.WORKDEPT = DEPTNO;</codeblock></example>
 </refbody>
 </reference>
-



Mime
View raw message