MySQL update and delete _ MySQL

Source: Internet
Author: User
The SQL statement for updating and deleting operations is relatively simple. However, when using UPDATE, pay attention to the limitations of the WEHER condition. the following statement only updates the email address with id 10005, if you do not apply the WHERE statement restriction, updating all emails in the table to elmer @ fuddcom for updating and deleting SQL statements is relatively simple. However, when using UPDATE, note the limitations of the WEHER condition. the following statement updates only the e-mail address with id 10005. if the WHERE statement restriction is not added, update all the emails in the table as elmer@fudd.com:


Delete the value of a column and set it to NULL.


Use DELETE to DELETE the SQL statement of a row. when using DELETE, add WHERE to DELETE the row you want to DELETE. If this parameter is not specified, all rows in the table will be deleted.

DELETE FROM MERS

WHERE cust_id = 10005;

Now we can see that the importance of the primary key of a table. In addition, before UPDATE and DELETE, you can use the SELECT statement to test whether the conditions specified by the WHERE statement are correct.

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.