Friday, 26 April 2013

How you update two columns in a table

How you update two columns in  a table ? write a query to update two columns in a table ?

It is simple if we want to update a single  column in a table we can use the below query

UPDATE TABLE "table-name" SET "column-name" = [new value] WHERE {condition}

e.g:
UPDATE TABLE employee SET ename="madhava" WHERE eid='1';

but the query to update multiple columns is as below

UPDATE TABLE "table-name" SET ("column1" , "column2") = ([new value1],[new value2])
WHERE ={condition }.

No comments:

Post a Comment