Low cost ecommerce web development India flash website design

The UPDATE Statement

UPDATE statements change data in one or more columns and in one or more

rows. The UPDATE statement is dangerous, because if you forget to specify

conditions, your database will happily update all the rows in the table. You

should always specify a WHERE condition when updating data. The

UPDATE statement has the following syntax:

UPDATE (tablename)

SET fieldl=(value|expression) [, field2=(value|expression)]...

FROM (table|query source)

WHERE (condition)

The UPDATE statement has four clauses. In the UPDATE clause, you must

specify a table name containing the fields to update. You may not update

multiple tables simultaneously.

The SET clause contains the list of fields you wish to update. You separate

the list with commas. Each item in the list consists of a field name, an equals

sign, and a new value. You can use a constant, a variable, a field from another

table, or an expression for the value on the right-hand side of the equals sign.

The FROM clause is optional. If you're updating a single row with constant

values, you can omit the FROM clause. You need the FROM clause when

you're updating data in one table from values stored in a different table (or in

another place in the same table). Fortunately, the FROM clause is identical to

the FROM clause you saw earlier in The SELECT Statement section. You

may update from multiple tables using JOIN statements as appropriate.

The WHERE clause (Important: don't forget the WHERE clause!), again,

is a condition that identifies the rows in the target table you wish to update.

freelance web designer India web development

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73