SQLite Learning Note 6: Updating table data

Source: Internet
Author: User
Tags sqlite

A conditional judgment

In SQL, the conditional judgment uses where, which is equivalent to the IF in the language, basic usage such as:

SELECT column1, Column2, columnn from Table_namewhere [condition]
In addition, SQL supports mathematical operations, logical operations, operations, and so on, which can be placed in the WHERE clause.


Two Update tables

The basic syntax is as follows:

UPDATE table_nameset column1 = value1, Column2 = value2 ...., columnn = valuenwhere [condition];

If the table has the following contents:

ID            NAME        age         ADDRESS     SALARY    ----------  ----------     ----------   ----------        --- -------1             James           Hubei           10000.0   2             June            Hubei           2500.0    3             Jack           Qianjiang     

Use the following statement to update:

Update company Set ADDRESS = ' China ' where ID = 1;

The updated table reads as follows:

ID            NAME        age         ADDRESS     SALARY    ----------  ----------     ----------   ----------        ----------1             James        China           10000.0   2             June            Hubei           2500.0    3             Jack           28           Qianjiang     





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.