SQL data Modification Statement

Source: Internet
Author: User
Tags expression table name

The statement used in the SQL language to modify data in a relational table in a database is update, which can be used to modify the values of one or more columns in a selected row in a relational table, using the following format:

Updata < table name >

Set column name = Expression,..., Column name = Expression

[where< search term;]

The search conditions in the WHERE clause are also allowed to contain another SELECT query statement.

Example 10: To the current no quota of sales staff assigned 6000 yuan quota.

Updata Salesreps

SET quota=6000

WHERE QUOTA is NULL

Example 11: A salesperson who accepts a total order over 9000 yuan after January 1, 1999 reports directly to John (number 104).

UPDATE Salesreps

SET manager=104

WHERE 9000< (SELECT SUM (AMOUNT)

From ORDERS WHERE order_date> "01-01-99"

References: SQL language tutorials SQL language basics

Back to the database basics ABC Directory

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.