MySQL's Action on Table records

Source: Internet
Author: User

1. Insert record--insert intoinsert into table_name (field1,field2,field3)  values (Value1,value2, VALUE3), or you can not specify a column name, but the order after values should be the same as the order in which the columns are arranged insert into table_name  values (Value1,value2, VALUE3), or insert multiple records insert into table_name (FIELD1,FIELD2,FIELD3)  values (VALUE1,VALUE2,VALUE3) at the same time ( VALUE1,VALUE2,VALUE3), (VALUE1,VALUE2,VALUE3); You can also insert values only on the specified columns, and default values for those that do not specify a column, or Nullinsert into if you do not specify a default value when you create the table.  table_name (field1,field2)  values (value1,value2); 2. Modify Records--updateupdate table_name set  field1=value1,field2=value2 where . . .mysql> select * from zhuzhu; +------+--------+------+------+| id   | myname | id1  | age   |+------+--------+------+------+| null | zhang3 | null | null  | |  null | li4    | null | null |+------+--------+------+- -----+2 ROWS&Nbsp;in set  (0.00 sec) mysql> update zhuzhu set id=1 where  Myname= ' Zhang3 '; query ok, 1 row affected  (0.05 sec) rows matched: 1  changed:  1  warnings: 0mysql> select * from zhuzhu;+------+--------+------+ ------+| id   | myname | id1  | age  |+------+---- ----+------+------+|    1 | zhang3 | null | null | |  null | li4    | null | null |+------+--------+------+- -----+2 rows in set  (0.01 SEC) 3. Deleting Records-delete fromdelete from table_name  where ...  #若没有where则是删除表中的所有的数据

This article from "Wave Scouring sand" blog, declined reprint!

MySQL's Action on Table records

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.