Friday, March 5, 2010

Simple update query

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

Syntax


UPDATE table_name
SET column1=value, column2=value2,...


UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value

something new::

The WHERE clause specifies which record or records that should be updated.
If you omit the WHERE clause, all records will be updated! so we can use where with update ........



Here

TABLE NAME=sqldemo
column name=id,pass,no,name


Example

UPDATE sqldemo
SET id='167', pass='1123';

Another example with where statement

UPDATE sqldemo
SET id='s167', pass='1s123'
WHERE no='23e';

UPDATE sqldemo
SET id='s167', pass='1s123'
WHERE no='23e'AND name='sam';


Check Backlinks

No comments: