mysql> insert into t11(name) values('Jack'),('Tom'),('Mark'),('Black'); Query OK, 4 rows affected (0.06 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql> create table t12(id int primary key auto_increment,name char(20)); Query OK, 0 rows affected (0.09 sec) mysql> insert in...
mysql> alter table student add status enum('1','0') default 1; Query OK, 0 rows affected (0.08 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> select * from student; +---+---+---+---+---+---+---+ | id | name | age | gender | cometime | birthday | status |...
#插入100W数据 mysql> call insert_user_data(1000000); Query OK,0rows affected (35.99sec) #添加相关索引 mysql> alter table user add index idx_name(name), add index idx_phone(phone); Query OK,0rows affected (6.00sec) Records:0Duplicates:0Warnings:0#表上索引统计信息 mysql> show index from...
#执行InnoDB的碎片回收mysql>altertableuserengine=InnoDB;QueryOK,0rowsaffected(9.00sec)Records:0Duplic...
0 rows affected (6.00 sec) Records: 0 Duplicates: 0 Warnings: 0 #表上索引统计信息 mysql...
/* Set no locks when applying log in online table rebuild. */ } else if (allow_duplicates) { /* If the SQL-query will update or replace duplicate key we will take X-lock for duplicates ( REPLACE, LOAD DATAFILE REPLACE, INSERT ON DUPLICATE KEY UPDATE). */ ...
select * from t_table_1 where task_id in (select id from t_table_2 where uid = #{uid}) 1. 回到这条简单sql,包含子查询,按照我们的理解,mysql应该是先执行子查询:select id from t_table_2 where uid = #{uid},然后再执行外部查询:select * from t_table_1 where task_id in(),但这不一...
Query OK, 5 rows affected (0.03 sec) Records: 5 Duplicates: 0 Warnings: 0 SELECT * FROM t1; +---+---+ | id | c1 | +---+---+ | 1 | 1 | | 2 | 2 | | 3 | 3 | | 4 | 4 | | 5 | 5 | +---+---+ 5 rows in set (0.00 sec) DELETE FROM t1 WHERE id =...
in mysql_update(thd=0x7fdcec000bc0, fields=..., values=..., limit=18446744073709551615, handle_duplicates=DUP_ERROR, found_return=0x7fe0c81c9c58, updated_return=0x7fe0c81c9c50) at /home/Code/GitHub/stonedb/sql/sql_update.cc:894#3 0x0000000002484ead in Sql_cmd_update::try_...
4 rows in set (0.01 sec) mysql> update t1 set address='zhuhai'; Query OK, 3 rows affected (0.09 sec) Rows matched: 4 Changed: 3 Warnings: 0 mysql> select * from t1; +---+---+---+---+ | id | name | sex | address | +---+---+---+...