~drizzle-trunk/drizzle/development

1878.5.4 by Brian Aker
Update documentation.
1
Updating Data
1900.2.8 by Stewart Smith
fix docs warning: underline/overline too short for update.rst
2
=============
1878.5.4 by Brian Aker
Update documentation.
3
1994.4.72 by Marisa Plumb
edits
4
In Drizzle you can make use of UPDATE to modify an existing record in a table.
1878.5.4 by Brian Aker
Update documentation.
5
1994.4.72 by Marisa Plumb
edits
6
An example query:
1878.5.4 by Brian Aker
Update documentation.
7
2165.2.5 by Andrew Hutchings
Make fixes to temporal docs
8
.. code-block:: mysql
9
10
   UPDATE TABLE_1 SET a="1" WHERE <condition>;
1878.5.4 by Brian Aker
Update documentation.
11
1994.4.38 by Marisa Plumb
multi-table exlanation to address https://bugs.launchpad.net/drizzle/+bug/686641
12
Multi-table delete and multi-table update code was removed from Drizzle.
13
2165.2.5 by Andrew Hutchings
Make fixes to temporal docs
14
Multi-update/delete can be accomplished through subqueries. For example:
15
16
.. code-block:: mysql
1994.4.38 by Marisa Plumb
multi-table exlanation to address https://bugs.launchpad.net/drizzle/+bug/686641
17
18
	UPDATE tableX SET tableXfield = (SELECT MAX(tableY.tableYfield) FROM tableY WHERE tableX.tableXfield = tableY.tableYfield)
19
2165.2.5 by Andrew Hutchings
Make fixes to temporal docs
20
In other database frameworks, multi-update and multi-delete are used to change information in *one* table, but the rows to change are determined by using more than one table. In that case, subqueries work to address the issue of changing information in one table based on information in more than one table.