Skip to content

Commit 49d7165

Browse files
committed
doc: Change table alias names to lower case in tutorial chapter
This is needlessly different from our usual style otherwise. Author: Jürgen Purtz <juergen@purtz.de> Discussion: https://www.postgresql.org/message-id/flat/158996922318.7035.10603922579567326239@wrigleys.postgresql.org
1 parent 79fd620 commit 49d7165

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

doc/src/sgml/query.sgml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -609,11 +609,11 @@ SELECT *
609609
following query:
610610

611611
<programlisting>
612-
SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high,
613-
W2.city, W2.temp_lo AS low, W2.temp_hi AS high
614-
FROM weather W1, weather W2
615-
WHERE W1.temp_lo &lt; W2.temp_lo
616-
AND W1.temp_hi &gt; W2.temp_hi;
612+
SELECT w1.city, w1.temp_lo AS low, w1.temp_hi AS high,
613+
w2.city, w2.temp_lo AS low, w2.temp_hi AS high
614+
FROM weather w1, weather w2
615+
WHERE w1.temp_lo &lt; w2.temp_lo
616+
AND w1.temp_hi &gt; w2.temp_hi;
617617
</programlisting>
618618

619619
<screen>
@@ -624,8 +624,8 @@ SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high,
624624
(2 rows)
625625
</screen>
626626

627-
Here we have relabeled the weather table as <literal>W1</literal> and
628-
<literal>W2</literal> to be able to distinguish the left and right side
627+
Here we have relabeled the weather table as <literal>w1</literal> and
628+
<literal>w2</literal> to be able to distinguish the left and right side
629629
of the join. You can also use these kinds of aliases in other
630630
queries to save some typing, e.g.:
631631
<programlisting>

src/tutorial/basics.source

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,13 @@ SELECT *
126126
FROM weather LEFT OUTER JOIN cities ON (weather.city = cities.name);
127127

128128
-- Suppose we want to find all the records that are in the temperature range
129-
-- of other records. W1 and W2 are aliases for weather.
129+
-- of other records. w1 and w2 are aliases for weather.
130130

131-
SELECT W1.city, W1.temp_lo, W1.temp_hi,
132-
W2.city, W2.temp_lo, W2.temp_hi
133-
FROM weather W1, weather W2
134-
WHERE W1.temp_lo < W2.temp_lo
135-
and W1.temp_hi > W2.temp_hi;
131+
SELECT w1.city, w1.temp_lo, w1.temp_hi,
132+
w2.city, w2.temp_lo, w2.temp_hi
133+
FROM weather w1, weather w2
134+
WHERE w1.temp_lo < w2.temp_lo
135+
and w1.temp_hi > w2.temp_hi;
136136

137137

138138
-----------------------------

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy