Tuesday, March 12, 2013

How to UPDATE data in database

How to update data in database system?

Try it using previous example from here because we need table with data.

To update data in database (MySQL, PostgreSQ etc.) use below code:


UPDATE cars
    SET        
        model = "Vectra 2"
    WHERE
        id = 3;
Remember that you need to have row with id = 3 in your database.
Otherwise just change "id" to other number in the above example.

No comments: