Author: paul
Date: 2006-03-20 16:33:35 +0100 (Mon, 20 Mar 2006)
New Revision: 1632
Log:
r8815@frost: paul | 2006-03-20 09:31:27 -0600
Whack a few comma joins and replace with INNER JOIN ... ON.
Modified:
trunk/
trunk/make.d/vars-docbook
trunk/refman-4.1/tutorial.xml
trunk/refman-5.0/tutorial.xml
trunk/refman-5.1/tutorial.xml
Property changes on: trunk
___________________________________________________________________
Name: svk:merge
- b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:8769
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:3931
+ b5ec3a16-e900-0410-9ad2-d183a3acac99:/mysqldoc-local/mysqldoc/trunk:8815
bf112a9c-6c03-0410-a055-ad865cd57414:/mysqldoc-local/mysqldoc/trunk:3931
Modified: trunk/make.d/vars-docbook
===================================================================
--- trunk/make.d/vars-docbook 2006-03-18 16:57:01 UTC (rev 1631)
+++ trunk/make.d/vars-docbook 2006-03-20 15:33:35 UTC (rev 1632)
@@ -34,7 +34,7 @@
# the chapterfmt.pl script to set the rootid parameter that tells xsltproc
# to format a single chapter.
-XSLTPROC = XML_CATALOG_FILES="$(XML_CATALOG_FILES)" xsltproc --xinclude --novalid $(XSLTPROC_EXTRA_FLAGS)
+XSLTPROC = xsltproc --xinclude --novalid $(XSLTPROC_EXTRA_FLAGS)
# ----------------------------------------------------------------------
# These variables can be overridden by setting them in the Makefile
Modified: trunk/refman-4.1/tutorial.xml
===================================================================
--- trunk/refman-4.1/tutorial.xml 2006-03-18 16:57:01 UTC (rev 1631)
+++ trunk/refman-4.1/tutorial.xml 2006-03-20 15:33:35 UTC (rev 1632)
@@ -2712,8 +2712,9 @@
mysql> <userinput>SELECT pet.name,</userinput>
-> <userinput>(YEAR(date)-YEAR(birth)) - (RIGHT(date,5)<RIGHT(birth,5)) AS age,</userinput>
-> <userinput>remark</userinput>
- -> <userinput>FROM pet, event</userinput>
- -> <userinput>WHERE pet.name = event.name AND event.type = 'litter';</userinput>
+ -> <userinput>FROM pet INNER JOIN event</userinput>
+ -> <userinput> ON pet.name = event.name</userinput>
+ -> <userinput>WHERE event.type = 'litter';</userinput>
+--------+------+-----------------------------+
| name | age | remark |
+--------+------+-----------------------------+
@@ -2731,7 +2732,7 @@
<listitem>
<para>
- The <literal>FROM</literal> clause lists two tables
+ The <literal>FROM</literal> clause joins two tables
because the query needs to pull information from both of
them.
</para>
@@ -2746,6 +2747,22 @@
<literal>WHERE</literal> clause to match up records in the
two tables based on the <literal>name</literal> values.
</para>
+
+ <para>
+ The query uses an <literal>INNER JOIN</literal> to combine
+ the tables. An <literal>INNER JOIN</literal> allows for
+ rows from either table to appear in the result if and only
+ if both tables meet the conditions specified in the
+ <option>ON</option> clause. In this example, the
+ <literal>ON</literal> clause specifies that the
+ <literal>name</literal> column in the
+ <literal>pet</literal> table must match the
+ <literal>name</literal> column in the
+ <literal>event</literal> table. If a name appears in one
+ table but not the other, the row will not appear in the
+ result because the condition in the <literal>ON</literal>
+ clause fails.
+ </para>
</listitem>
<listitem>
@@ -2770,8 +2787,8 @@
<programlisting>
mysql> <userinput>SELECT p1.name, p1.sex, p2.name, p2.sex, p1.species</userinput>
- -> <userinput>FROM pet AS p1, pet AS p2</userinput>
- -> <userinput>WHERE p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+ -> <userinput>FROM pet AS p1 INNER JOIN pet AS p2</userinput>
+ -> <userinput> ON p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+--------+------+--------+------+---------+
| name | sex | name | sex | species |
+--------+------+--------+------+---------+
@@ -3567,9 +3584,9 @@
+----+---------+--------+-------+
-SELECT s.* FROM person p, shirt s
+SELECT s.* FROM person p INNER JOIN shirt s
+ ON s.owner = p.id
WHERE p.name LIKE 'Lilliana%'
- AND s.owner = p.id
AND s.color <> 'white';
+----+-------+--------+-------+
Modified: trunk/refman-5.0/tutorial.xml
===================================================================
--- trunk/refman-5.0/tutorial.xml 2006-03-18 16:57:01 UTC (rev 1631)
+++ trunk/refman-5.0/tutorial.xml 2006-03-20 15:33:35 UTC (rev 1632)
@@ -2698,8 +2698,9 @@
mysql> <userinput>SELECT pet.name,</userinput>
-> <userinput>(YEAR(date)-YEAR(birth)) - (RIGHT(date,5)<RIGHT(birth,5)) AS age,</userinput>
-> <userinput>remark</userinput>
- -> <userinput>FROM pet, event</userinput>
- -> <userinput>WHERE pet.name = event.name AND event.type = 'litter';</userinput>
+ -> <userinput>FROM pet INNER JOIN event</userinput>
+ -> <userinput> ON pet.name = event.name</userinput>
+ -> <userinput>WHERE event.type = 'litter';</userinput>
+--------+------+-----------------------------+
| name | age | remark |
+--------+------+-----------------------------+
@@ -2717,7 +2718,7 @@
<listitem>
<para>
- The <literal>FROM</literal> clause lists two tables
+ The <literal>FROM</literal> clause joins two tables
because the query needs to pull information from both of
them.
</para>
@@ -2732,6 +2733,22 @@
<literal>WHERE</literal> clause to match up records in the
two tables based on the <literal>name</literal> values.
</para>
+
+ <para>
+ The query uses an <literal>INNER JOIN</literal> to combine
+ the tables. An <literal>INNER JOIN</literal> allows for
+ rows from either table to appear in the result if and only
+ if both tables meet the conditions specified in the
+ <option>ON</option> clause. In this example, the
+ <literal>ON</literal> clause specifies that the
+ <literal>name</literal> column in the
+ <literal>pet</literal> table must match the
+ <literal>name</literal> column in the
+ <literal>event</literal> table. If a name appears in one
+ table but not the other, the row will not appear in the
+ result because the condition in the <literal>ON</literal>
+ clause fails.
+ </para>
</listitem>
<listitem>
@@ -2756,8 +2773,8 @@
<programlisting>
mysql> <userinput>SELECT p1.name, p1.sex, p2.name, p2.sex, p1.species</userinput>
- -> <userinput>FROM pet AS p1, pet AS p2</userinput>
- -> <userinput>WHERE p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+ -> <userinput>FROM pet AS p1 INNER JOIN pet AS p2</userinput>
+ -> <userinput> ON p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+--------+------+--------+------+---------+
| name | sex | name | sex | species |
+--------+------+--------+------+---------+
@@ -3428,9 +3445,9 @@
+----+---------+--------+-------+
-SELECT s.* FROM person p, shirt s
+SELECT s.* FROM person p INNER JOIN shirt s
+ ON s.owner = p.id
WHERE p.name LIKE 'Lilliana%'
- AND s.owner = p.id
AND s.color <> 'white';
+----+-------+--------+-------+
Modified: trunk/refman-5.1/tutorial.xml
===================================================================
--- trunk/refman-5.1/tutorial.xml 2006-03-18 16:57:01 UTC (rev 1631)
+++ trunk/refman-5.1/tutorial.xml 2006-03-20 15:33:35 UTC (rev 1632)
@@ -2692,8 +2692,9 @@
mysql> <userinput>SELECT pet.name,</userinput>
-> <userinput>(YEAR(date)-YEAR(birth)) - (RIGHT(date,5)<RIGHT(birth,5)) AS age,</userinput>
-> <userinput>remark</userinput>
- -> <userinput>FROM pet, event</userinput>
- -> <userinput>WHERE pet.name = event.name AND event.type = 'litter';</userinput>
+ -> <userinput>FROM pet INNER JOIN event</userinput>
+ -> <userinput> ON pet.name = event.name</userinput>
+ -> <userinput>WHERE event.type = 'litter';</userinput>
+--------+------+-----------------------------+
| name | age | remark |
+--------+------+-----------------------------+
@@ -2711,7 +2712,7 @@
<listitem>
<para>
- The <literal>FROM</literal> clause lists two tables
+ The <literal>FROM</literal> clause joins two tables
because the query needs to pull information from both of
them.
</para>
@@ -2726,6 +2727,22 @@
<literal>WHERE</literal> clause to match up records in the
two tables based on the <literal>name</literal> values.
</para>
+
+ <para>
+ The query uses an <literal>INNER JOIN</literal> to combine
+ the tables. An <literal>INNER JOIN</literal> allows for
+ rows from either table to appear in the result if and only
+ if both tables meet the conditions specified in the
+ <option>ON</option> clause. In this example, the
+ <literal>ON</literal> clause specifies that the
+ <literal>name</literal> column in the
+ <literal>pet</literal> table must match the
+ <literal>name</literal> column in the
+ <literal>event</literal> table. If a name appears in one
+ table but not the other, the row will not appear in the
+ result because the condition in the <literal>ON</literal>
+ clause fails.
+ </para>
</listitem>
<listitem>
@@ -2750,8 +2767,8 @@
<programlisting>
mysql> <userinput>SELECT p1.name, p1.sex, p2.name, p2.sex, p1.species</userinput>
- -> <userinput>FROM pet AS p1, pet AS p2</userinput>
- -> <userinput>WHERE p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+ -> <userinput>FROM pet AS p1 INNER JOIN pet AS p2</userinput>
+ -> <userinput> ON p1.species = p2.species AND p1.sex = 'f' AND p2.sex = 'm';</userinput>
+--------+------+--------+------+---------+
| name | sex | name | sex | species |
+--------+------+--------+------+---------+
@@ -3422,9 +3439,9 @@
+----+---------+--------+-------+
-SELECT s.* FROM person p, shirt s
+SELECT s.* FROM person p INNER JOIN shirt s
+ ON s.owner = p.id
WHERE p.name LIKE 'Lilliana%'
- AND s.owner = p.id
AND s.color <> 'white';
+----+-------+--------+-------+
| Thread |
|---|
| • svn commit - mysqldoc@docsrva: r1632 - in trunk: . make.d refman-4.1 refman-5.0 refman-5.1 | paul | 20 Mar |