UPDATE


InterServer Web Hosting and VPS
Sony Playstation PS4 Pro Custom Build NVMe SSD Drive - Enclosure case and Crucial NVMe SSD
PS4 Pro Custom External SSD NVMe Drive

How I built a PS4 Pro Custom External SSD NVMe Drive...

NUC8i7BEH with memory
Intel NUC8I7BEH Review and Custom Build

This is my review of the Intel NUC8i7BEH and a summary of my build...

Card image cap
Asus M5A88-M EVO Review

This is my review of the Asus M5A88-M EVO motherboard...

Corsair Vengeance Blue 8GB (2x4GB) DDR3 PC3-12800C9 1600MHz Dual Channel Kit
Corsair Vengeance Blue Review

This is my review of the Corsair Vengeance Blue 8GB (2x4GB) DDR3 PC3-12800C9 1600MHz Dual Channel Kit memory...

Robotic Arm with USB PC Interface Review
Robotic Arm with USB PC Interface Review

This is my review of the Robotic Arm with USB PC Interface...

UPDATE

Here we look at the Update command in SQL.

The Update command in SQL allows us to update data in a database table, where data already exists and we would like to change some of it.

You can change just one row or you can modify multiple rows at the same time.

In the following example, we look at the table called Customers. We use the Update command to change the telephone number of every row whose name value is Fred, thus every Fred will have the same phone number now.


-- Update all Customers called Fred to have telephone number 55555
UPDATE Customers SET Telephone = '55555' WHERE Name = 'Fred'


If you want to update more than one column, just specify the name of each column seperated by commas, and provide a value which will be entered.

The following example continues from the first example by changing the mobile as well as the telephone value, and also only changes the details of rows who name is Fred but only where the company value is World Ltd as well.


-- Update all Customers called Fred and from the company called World Ltd
-- to have telephone number 55555 and a mobile number of 77777
UPDATE Customers SET Telephone = '55555', Mobile = '77777'
WHERE Name = 'Fred' AND Company = 'World Ltd'


Sponsored Links
SolarSystem - AngularJS Demo
SolarSystem - Angular JS Demo

Check out my first Angular JS demo hosted in Azure, it helped win my first Angular contract. Put the sound on.