subscribe: Posts | Comments

Syntax and examples to edit records in a table

0 comments

Update is the instruction that helps us to amend our records. As for the case of Delete, we need to specify by what Where are the records in which we implement our changes. Also, obviously, have to specify what the new field values we want to upgrade. The syntax is like this:
Update September nombre_campo1 tbl_name = valor_campo1, nombre_campo2 = valor_campo2 … Where condiciones_de_selección

An example applied:

September Update client name = ‘Jose’ Where name = ‘Pepe’
By this ruling we change the name of Jose Pepe by all the records whose name is Pepe.
Here too we must be careful not to forget Where used, otherwise revise all the records from our table.

What if I have a table with three fields and I just want to modify a register, two courses, my fields. key, name, pass.

Registration is:

key = ce01
name = stop
pass = 0215

And the change you wish to make is

key = ce01
name Caesar
pass = 215

RESPONSE

Then use the UPDATE statement with a syntax like this (I assume that your table is called user and want to change the fields name and pass, both in text format. I also understand that the key is in text format and is unique for each user):

September update user name = "Cesar," pass = "215" where key = "ce01"