SQL update syntax and Examples

Source: Internet
Author: User

SQL update syntax and Examples

The routine database tutorial is an ever-changing data storage. SQL is used to modify The data that has been updated in The database and delete commands. The update statement can update one or more record commands in The table.

UPDATE table_name

SET column_name = expression

WHERE conditions

Instance 1

UPDATE AntiqueOwners

SET Address = '77, Lincoln st .'

WHERE OwnerFirstName = 'jar' and OwnerLastName = 'akins'

The update statement can be used to declare a field in the updated table. This will update the AntiqueOwners table. The ekins address is 77, Lincoln St ..

Note: update does not generate a result set. If you want to know which records will be modified, first run the SELECT query, which uses the same standard. If the results are satisfactory, run the update query.

Instance 2

UPDATE AntiqueOwners

SET Address = '77, Lincoln st. ', City = 'kirk', State = 'Washington'

WHERE OwnerFirstName = 'jar' And OwnerLastName = 'akins'

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.