SGML improvements to the DML chapter.
This commit is contained in:
parent
a2ad04f4b0
commit
87aafa1600
@ -1,4 +1,4 @@
|
|||||||
<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.10 2005/01/22 22:56:35 momjian Exp $ -->
|
<!-- $PostgreSQL: pgsql/doc/src/sgml/dml.sgml,v 1.11 2005/03/01 23:45:00 neilc Exp $ -->
|
||||||
|
|
||||||
<chapter id="dml">
|
<chapter id="dml">
|
||||||
<title>Data Manipulation</title>
|
<title>Data Manipulation</title>
|
||||||
@ -38,10 +38,10 @@
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
To create a new row, use the <literal>INSERT</literal> command.
|
To create a new row, use the <xref linkend="sql-insert"
|
||||||
The command requires the table name and a value for each of the
|
xreflabel="sql-insert-title"> command. The command requires the
|
||||||
columns of the table. For example, consider the products table
|
table name and a value for each of the columns of the table. For
|
||||||
from <xref linkend="ddl">:
|
example, consider the products table from <xref linkend="ddl">:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
CREATE TABLE products (
|
CREATE TABLE products (
|
||||||
product_no integer,
|
product_no integer,
|
||||||
@ -98,7 +98,9 @@ INSERT INTO products DEFAULT VALUES;
|
|||||||
To do <quote>bulk loads</quote>, that is, inserting a lot of data,
|
To do <quote>bulk loads</quote>, that is, inserting a lot of data,
|
||||||
take a look at the <xref linkend="sql-copy"
|
take a look at the <xref linkend="sql-copy"
|
||||||
endterm="sql-copy-title"> command. It is not as flexible as the
|
endterm="sql-copy-title"> command. It is not as flexible as the
|
||||||
<command>INSERT</command> command, but is more efficient.
|
<command>INSERT</command> command, but is more efficient. Refer to
|
||||||
|
<xref linkend="populate"> for more information on improving bulk
|
||||||
|
loading performance.
|
||||||
</para>
|
</para>
|
||||||
</tip>
|
</tip>
|
||||||
</sect1>
|
</sect1>
|
||||||
@ -188,7 +190,7 @@ UPDATE products SET price = price * 1.10;
|
|||||||
|
|
||||||
<para>
|
<para>
|
||||||
You can update more than one column in an
|
You can update more than one column in an
|
||||||
<literal>UPDATE</literal> command by listing more than one
|
<command>UPDATE</command> command by listing more than one
|
||||||
assignment in the <literal>SET</literal> clause. For example:
|
assignment in the <literal>SET</literal> clause. For example:
|
||||||
<programlisting>
|
<programlisting>
|
||||||
UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0;
|
UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0;
|
||||||
@ -222,9 +224,11 @@ UPDATE mytable SET a = 5, b = 3, c = 1 WHERE a > 0;
|
|||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
You use the <literal>DELETE</literal> command to remove rows; the
|
You use the <xref linkend="sql-delete"
|
||||||
syntax is very similar to the <literal>UPDATE</literal> command.
|
xreflabel="sql-delete-title"> command to remove rows; the syntax is
|
||||||
For instance, to remove all rows from the products table that have a price of 10, use
|
very similar to the <command>UPDATE</command> command. For
|
||||||
|
instance, to remove all rows from the products table that have a
|
||||||
|
price of 10, use
|
||||||
<programlisting>
|
<programlisting>
|
||||||
DELETE FROM products WHERE price = 10;
|
DELETE FROM products WHERE price = 10;
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user