SQL update syntax and instances

Source: Internet
Author: User

SQL update syntax and instances

The daily use of the database tutorial is a constantly changing data store. In SQL is used to modify data that has been updated and deleted in the database commands.the UPDATE statement can update one or more record commands in the table.

UPDATE table_name
SET column_name = Expression
WHERE conditions

Instance One

UPDATE antiqueowners
SET address = ', Lincoln St. '
WHERE ownerfirstname= ' Jane ' and ownerlastname = ' Akins '

The UPDATE statement can be used in the updated table. This declares that a field will update the Antiqueowners table Jane Akins address 77, Lincoln St..

Note: The update does not generate a result set. If you want to know which records will be modified, run the Select query first, and it uses the same criteria. If the results are satisfactory, then run an update query.

Example Two

UPDATE antiqueowners
SET address = ', Lincoln St. ', city = ' Kirkland ', state = ' Washington '
WHERE ownerfirstname= ' Jane ' and ownerlastname= ' Akins '

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.