DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
SQL
IT Tags

The UPDATE statement

By: rekha singh | 28 Apr 2010 1:03 pm
The UPDATE  statement
 
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';
 

 

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move