mirror of
https://github.com/postgres/postgres.git
synced 2025-05-30 00:02:11 -04:00
doc: Use tags consistently in the tutorial chapter
Make more consistent use of <screen> and <programlisting>. Author: Jürgen Purtz <juergen@purtz.de> Discussion: https://www.postgresql.org/message-id/flat/158996922318.7035.10603922579567326239@wrigleys.postgresql.org
This commit is contained in:
parent
96cfcadd26
commit
6eee73e4e5
@ -564,14 +564,16 @@ SELECT *
|
|||||||
<programlisting>
|
<programlisting>
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM weather LEFT OUTER JOIN cities ON (weather.city = cities.name);
|
FROM weather LEFT OUTER JOIN cities ON (weather.city = cities.name);
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<screen>
|
||||||
city | temp_lo | temp_hi | prcp | date | name | location
|
city | temp_lo | temp_hi | prcp | date | name | location
|
||||||
---------------+---------+---------+------+------------+---------------+-----------
|
---------------+---------+---------+------+------------+---------------+-----------
|
||||||
Hayward | 37 | 54 | | 1994-11-29 | |
|
Hayward | 37 | 54 | | 1994-11-29 | |
|
||||||
San Francisco | 46 | 50 | 0.25 | 1994-11-27 | San Francisco | (-194,53)
|
San Francisco | 46 | 50 | 0.25 | 1994-11-27 | San Francisco | (-194,53)
|
||||||
San Francisco | 43 | 57 | 0 | 1994-11-29 | San Francisco | (-194,53)
|
San Francisco | 43 | 57 | 0 | 1994-11-29 | San Francisco | (-194,53)
|
||||||
(3 rows)
|
(3 rows)
|
||||||
</programlisting>
|
</screen>
|
||||||
|
|
||||||
This query is called a <firstterm>left outer
|
This query is called a <firstterm>left outer
|
||||||
join</firstterm> because the table mentioned on the left of the
|
join</firstterm> because the table mentioned on the left of the
|
||||||
@ -612,13 +614,15 @@ SELECT W1.city, W1.temp_lo AS low, W1.temp_hi AS high,
|
|||||||
FROM weather W1, weather W2
|
FROM weather W1, weather W2
|
||||||
WHERE W1.temp_lo < W2.temp_lo
|
WHERE W1.temp_lo < W2.temp_lo
|
||||||
AND W1.temp_hi > W2.temp_hi;
|
AND W1.temp_hi > W2.temp_hi;
|
||||||
|
</programlisting>
|
||||||
|
|
||||||
|
<screen>
|
||||||
city | low | high | city | low | high
|
city | low | high | city | low | high
|
||||||
---------------+-----+------+---------------+-----+------
|
---------------+-----+------+---------------+-----+------
|
||||||
San Francisco | 43 | 57 | San Francisco | 46 | 50
|
San Francisco | 43 | 57 | San Francisco | 46 | 50
|
||||||
Hayward | 37 | 54 | San Francisco | 46 | 50
|
Hayward | 37 | 54 | San Francisco | 46 | 50
|
||||||
(2 rows)
|
(2 rows)
|
||||||
</programlisting>
|
</screen>
|
||||||
|
|
||||||
Here we have relabeled the weather table as <literal>W1</literal> and
|
Here we have relabeled the weather table as <literal>W1</literal> and
|
||||||
<literal>W2</literal> to be able to distinguish the left and right side
|
<literal>W2</literal> to be able to distinguish the left and right side
|
||||||
|
Loading…
x
Reference in New Issue
Block a user