摘要: CASE语句 CASE case_value WHEN when_value THEN statement_list [WHEN when_value THEN statement_list] ... [ELSE statement_list] END CASE CASE WHEN search_c 阅读全文
posted @ 2020-08-18 08:50 wongchaofan 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Local Variable DECLARE Statement DECLARE var_name [, var_name] ... type [DEFAULT value] 该语句在存储的程序中声明局部变量。要提供变量的默认值,请包含一个 DEFAULT子句。该值可以指定为表达式;它不必是常数。如 阅读全文
posted @ 2020-08-18 08:06 wongchaofan 阅读(127) 评论(0) 推荐(0) 编辑
摘要: [begin_label:] BEGIN [statement_list] END [end_label] [begin_label:] LOOP statement_list END LOOP [end_label] [begin_label:] REPEAT statement_list UNT 阅读全文
posted @ 2020-08-18 07:26 wongchaofan 阅读(106) 评论(0) 推荐(0) 编辑
摘要: [begin_label:] BEGIN [statement_list] END [end_label] BEGIN ... END 语法用于编写复合语句,复合语句可以出现在存储程序(存储过程和函数,触发器和事件)中。复合语句可以包含多个语句,并用BEGIN和 END关键字括起来。 stateme 阅读全文
posted @ 2020-08-18 07:16 wongchaofan 阅读(242) 评论(0) 推荐(0) 编辑
摘要: https://dev.mysql.com/doc/refman/5.7/en/sql-prepared-statements.html 阅读全文
posted @ 2020-08-18 06:51 wongchaofan 阅读(70) 评论(0) 推荐(0) 编辑
摘要: SET [GLOBAL | SESSION] TRANSACTION transaction_characteristic [, transaction_characteristic] ... transaction_characteristic: { ISOLATION LEVEL level | 阅读全文
posted @ 2020-08-18 06:43 wongchaofan 阅读(462) 评论(0) 推荐(0) 编辑
摘要: LOCK TABLES tbl_name [[AS] alias] lock_type [, tbl_name [[AS] alias] lock_type] ... lock_type: { READ [LOCAL] | [LOW_PRIORITY] WRITE } UNLOCK TABLES M 阅读全文
posted @ 2020-08-18 06:21 wongchaofan 阅读(251) 评论(0) 推荐(0) 编辑
摘要: SAVEPOINT identifier ROLLBACK [WORK] TO [SAVEPOINT] identifier RELEASE SAVEPOINT identifier InnoDB supports the SQL statements SAVEPOINT, ROLLBACK TO 阅读全文
posted @ 2020-08-18 02:24 wongchaofan 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 事务控制语句和锁语句也有例外:如果一个隐式提交发生在执行之前,那么其他的在之后也不会发生。 Data definition language (DDL) statements that define or modify database objects. ALTER DATABASE ... UPG 阅读全文
posted @ 2020-08-18 02:20 wongchaofan 阅读(238) 评论(0) 推荐(0) 编辑
摘要: https://dev.mysql.com/doc/refman/5.7/en/commit.html START TRANSACTION [transaction_characteristic [, transaction_characteristic] ...] transaction_char 阅读全文
posted @ 2020-08-18 01:57 wongchaofan 阅读(98) 评论(0) 推荐(0) 编辑
摘要: UPDATE is a DML statement that modifies rows in a table. Single-table syntax: UPDATE [LOW_PRIORITY] [IGNORE] table_reference SET assignment_list [WHER 阅读全文
posted @ 2020-08-18 01:17 wongchaofan 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 不建议使用子查询,能用链接的用链接,子查询影响服务器性能。 SELECT * FROM t1 WHERE column1 = (SELECT column1 FROM t2); DELETE FROM t1 WHERE s11 > ANY (SELECT COUNT(*) /* no hint */ 阅读全文
posted @ 2020-08-18 00:37 wongchaofan 阅读(70) 评论(0) 推荐(0) 编辑
摘要: SELECT [ALL | DISTINCT | DISTINCTROW ] [HIGH_PRIORITY] [STRAIGHT_JOIN] [SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT] [SQL_CACHE | SQL_NO_CAC 阅读全文
posted @ 2020-08-18 00:35 wongchaofan 阅读(256) 评论(0) 推荐(0) 编辑
摘要: REPLACE [LOW_PRIORITY | DELAYED] [INTO] tbl_name [PARTITION (partition_name [, partition_name] ...)] [(col_name [, col_name] ...)] {VALUES | VALUE} (v 阅读全文
posted @ 2020-08-18 00:18 wongchaofan 阅读(357) 评论(0) 推荐(0) 编辑
摘要: LOAD XML [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE [db_name.]tbl_name [CHARACTER SET charset_name] [ROWS ID 阅读全文
posted @ 2020-08-18 00:13 wongchaofan 阅读(290) 评论(0) 推荐(0) 编辑
摘要: LOAD DATA [LOW_PRIORITY | CONCURRENT] [LOCAL] INFILE 'file_name' [REPLACE | IGNORE] INTO TABLE tbl_name [PARTITION (partition_name [, partition_name] 阅读全文
posted @ 2020-08-18 00:10 wongchaofan 阅读(167) 评论(0) 推荐(0) 编辑
摘要: INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE] [INTO] tbl_name [PARTITION (partition_name [, partition_name] ...)] [(col_name [, col_name] . 阅读全文
posted @ 2020-08-18 00:07 wongchaofan 阅读(1347) 评论(0) 推荐(0) 编辑