~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to docs/update.rst

  • Committer: patrick crews
  • Date: 2011-02-23 17:17:25 UTC
  • mto: (2195.1.1 build)
  • mto: This revision was merged to the branch mainline in revision 2196.
  • Revision ID: gleebix@gmail.com-20110223171725-4tgewemxhsw1m7q8
Integrated randgen with dbqp.  We now have mode=randgen and a set of randgen test suites (very basic now).  Output = same as dtr : )  We also have mode=cleanup to kill any servers we have started.  Docs updates too.  Gendata utility allows us to populate test servers 

Show diffs side-by-side

added added

removed removed

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