i have table and the table have many records , now i want to edit data in one column in the row not all the row columns
what is the statement to update some columns not all !!
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted May 28, 2012, 3:35 PM
The UPDATE statement is used to update records in a table.
The UPDATE Statement
The UPDATE statement is used to update existing records in a table.
SQL UPDATE Syntax
SET column1=value, column2=value2,...
WHERE some_column=some_value
Note: Notice the WHERE clause in the UPDATE syntax. The WHERE clause specifies which record or records that should be updated. If you omit the WHERE clause, all records will be updated!
SQL UPDATE Example
The "Persons" table:
Now we want to update the person "Tjessem, Jakob" in the "Persons" table.
We use the following SQL statement:
SET Address='Nissestien 67', City='Sandnes'
WHERE LastName='Tjessem' AND FirstName='Jakob'
The "Persons" table will now look like this:
SQL UPDATE Warning
Be careful when updating records. If we had omitted the WHERE clause in the example above, like this:
SET Address='Nissestien 67', City='Sandnes'
The "Persons" table would have looked like this:
Please refer the below link
http://www.w3schools.com/sql/sql_update.asp
Thanks
Anil KumarPosted May 28, 2012, 3:04 PM
UPDATE myTableName
SET myUpdateRequiredColName = newValue
WHERE