Thursday 4 December 2014

SQL UPDATE Statement

The SQL UPDATE Statement

          The UPDATE statement is used to update existing records in a table.

Syntax:
update tablename set columnname1 = value where columnname = value.
(or)
update tablename set columnname1 = value,columnname2 = value,.... where columnname = value.

Example :
update empdetails set name = peter where id = 1

The WHERE clause specifies which record or records that should be updated. If you omit the WHERE clause, all records will be updated!


No comments:

Post a Comment