INSERT

INSERT

The INSERT syntax can be any of the following:

INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] table_name    [(field_name,...)] VALUES ((expression | DEFAULT),...),(...),... INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] table_name    [(field_name,...)] SELECT ... INSERT [LOW_PRIORITY | DELAYED] [IGNORE] [INTO] table_name    SET field_name=(expression | DEFAULT), ... INSERT [LOW_PRIORITY] [IGNORE] [INTO] table_name [(field list)]  SELECT ...

INSERT adds new rows into a table. Without the initial field list, fields are assumed to be in the same order as they were defined, and a value must exist for each field. Any columns not explicitly set are set to their default value.

The LOW PRIORITY keyword causes the INSERT to wait until no other clients are reading the table before processing it. With the DELAYED keyword, MySQL frees the client but waits to perform the INSERT.

IGNORE causes MySQL to ignore INSERTs that would causes a duplicate primary key or unique key, instead of aborting the INSERT.

INSERT...SELECT allows you to INSERT into a table from existing rows in one or more tables.



Mastering MySQL 4
Mastering MySQL 4
ISBN: 0782141625
EAN: 2147483647
Year: 2003
Pages: 230
Authors: Ian Gilfillan

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net