~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/update.rst

  • Committer: lbieber at stabletransit
  • Date: 2010-10-19 14:03:27 UTC
  • mfrom: (1861.1.2 build)
  • Revision ID: lbieber@drizzle-build-n02.wc1.dfw1.stabletransit.com-20101019140327-2jvt5j2wi4pzhm1z
Merge Brian - Small collection of cleanups/refactor'ing around locks
Merge Monty - fix a few things in the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Updating Data
2
 
=============
3
 
 
4
 
In Dizzle you can make use of UPDATE to modify an existing record in a table.
5
 
 
6
 
A type query:
7
 
 
8
 
UPDATE TABLE_1 SET a="1" WHERE <condition>;
9
 
 
10
 
Multi-table delete and multi-table update code was removed from Drizzle.
11
 
 
12
 
Multi-update/delete can be accomplished through subqueries. For example: ::
13
 
 
14
 
        UPDATE tableX SET tableXfield = (SELECT MAX(tableY.tableYfield) FROM tableY WHERE tableX.tableXfield = tableY.tableYfield)
15
 
 
16
 
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.
 
 
b'\\ No newline at end of file'