"Fossies" - the Fresh Open Source Software Archive

Member "drizzle-7.1.36-stable/docs/update.rst" (6 May 2012, 803 Bytes) of package /linux/misc/old/drizzle-7.1.36-stable.tar.gz:

As a special service "Fossies" has tried to format the requested source page into HTML format (assuming markdown format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Updating Data

In Drizzle you can make use of UPDATE to modify an existing record in a table.

An example query:

UPDATE TABLE_1 SET a="1" WHERE <condition>;

Multi-table delete and multi-table update code was removed from Drizzle.

Multi-update/delete can be accomplished through subqueries. For example:

UPDATE tableX SET tableXfield = (SELECT MAX(tableY.tableYfield) FROM tableY WHERE tableX.tableXfield = tableY.tableYfield)

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.