Narayana Tutorial

Online Java Tutorial Blog

SQL UPDATE

SQL UPDATE

The UPDATE command is used to change or update data values in a table.

UPDATE all rows one column

Syntax

UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value>

Example

UPDATE EMPLOYEE SET COUNTRY="INDIA";

UPDATE all rows more than one column

Syntax

UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value>, 
<ColumnName 2>=<Expression> or <Value>

Example

UPDATE EMPLOYEE SET COUNTRY="INDIA", STATE="MH"

UPDATE records conditionally

Syntax

UPDATE <TableName> SET <ColumnName 1>=<Expression> or <Value>,
<ColumnName 2>=<Expression> or <Value> WHERE <Condition>

Example

UPDATE EMPLOYEE SET COUNTRY="INDIA", STATE="MH" WHERE ID LIKE '123%'

,

Narayanaswamy

Hello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in IT industry more than 7 years. NarayanaTutorial is my web technologies blog. My specialties are Java / J2EE, Spring, Hibernate, Struts, Webservices, PHP, Oracle, MySQL, SQLServer, Web Hosting and Website Development.

I am a self learner and passionate about training and writing. I am always trying my best to share my knowledge through my blog.

Leave a Reply

Narayana Tutorial © 2018 Frontier Theme
Show Button
Hide Button