1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | SELECT [ ALL | DISTINCT | DISTINCTROW ] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS] select_expr, ... [ FROM table_references [ WHERE where_condition] [ GROUP BY {col_name | expr | position} [ ASC | DESC ], ... [ WITH ROLLUP ]] [ HAVING where_condition] [ ORDER BY {col_name | expr | position} [ ASC | DESC ], ...] [LIMIT {[offset,] row_count | row_count OFFSET offset}] [ PROCEDURE procedure_name(argument_list)] [ INTO OUTFILE 'file_name' export_options | INTO DUMPFILE 'file_name' | INTO @var_name [, @var_name]] [ FOR UPDATE | LOCK IN SHARE MODE]] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [ IGNORE ] [ INTO ] tbl_name [(col_name,...)] VALUES ({expr | DEFAULT },...),(...),... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ] Or : INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [ IGNORE ] [ INTO ] tbl_name SET col_name={expr | DEFAULT }, ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ] Or : INSERT [LOW_PRIORITY | HIGH_PRIORITY] [ IGNORE ] [ INTO ] tbl_name [(col_name,...)] SELECT ... [ ON DUPLICATE KEY UPDATE col_name=expr, ... ] |
1 2 3 4 5 6 7 8 9 10 11 12 13 | Single- table syntax: UPDATE [LOW_PRIORITY] [ IGNORE ] tbl_name SET col_name1=expr1 [, col_name2=expr2 ...] [ WHERE where_condition] [ ORDER BY ...] [LIMIT row_count] Multiple- table syntax: UPDATE [LOW_PRIORITY] [ IGNORE ] table_references SET col_name1=expr1 [, col_name2=expr2 ...] [ WHERE where_condition] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | Single- table syntax: DELETE [LOW_PRIORITY] [QUICK] [ IGNORE ] FROM tbl_name [ WHERE where_condition] [ ORDER BY ...] [LIMIT row_count] Multiple- table syntax: DELETE [LOW_PRIORITY] [QUICK] [ IGNORE ] tbl_name[.*] [, tbl_name[.*]] ... FROM table_references [ WHERE where_condition] Or : DELETE [LOW_PRIORITY] [QUICK] [ IGNORE ] FROM tbl_name[.*] [, tbl_name[.*]] ... USING table_references [ WHERE where_condition] |