mysql> create table t12(id int primary key auto_increment,name char(20)); Query OK, 0 rows affected (0.09 sec) mysql> insert into t12(name) values('Jack'),('Tom'),('Mark'),('Black'); Query OK, 4 rows affected (0.03 sec) Records: 4 Duplicates: 0 Warnings: 0 mysql> select *...
#插入100W数据 mysql> call insert_user_data(1000000); Query OK, 0 rows affected (35.99 sec) #添加相关索引 mysql> alter table user add index idx_name(name), add index idx_phone(phone); Query OK, 0 rows affected (6.00 sec) Records: 0 Duplicates: 0 Warnings: 0 #表上索引统计信息 mysql...
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 |...
first_level=true) at /home/Code/GitHub/stonedb/sql/sql_parse.cc:3645#6 0x00000000023d175d in mysql_parse(thd=0x7fdcec000bc0,parser_state=0x7fe0c81cae70) at /home/Code/GitHub/stonedb/sql/sql_parse.cc:5655#7 0x00000000023c68b8 in dispatch_command(thd=0x7fdcec000bc0,com_dat...
#插入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...
CREATE TABLE t1 (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT, c1 INT NOT NULL); Query OK, 0 rows affected (0.11 sec) INSERT INTO t1 (c1) VALUES (1),(2),(3),(4),(5); Query OK, 5 rows affected (0.03 sec) Records: 5 Duplicates: 0 Warnings: 0 ...
mysql> create table t1 ( -> id int unsigned not null auto_increment, -> name char(20) not null, -> sex enum('f','m') not null default 'm', -> address varchar(30) not null, -> primary key(id) -> ); Query OK, 0 rows affected (0.31 sec) ...
回到这条简单sql,包含子查询,按照我们的理解,mysql应该是先执行子查询:select id from t_table_2 where uid = #{uid},然后再执行外部查询:select * from t_table_1 where task_id in(),但这不一定,例如我关了这个参数: set optimizer_switch='semijoin=off'; ...
I am trying to find if data (let's say rows) duplicate in Table 1 first and remove them. Then I want to see if Table 2 duplicates any of Table 1's rows and remove them from Table 2. Then I will have both tables as clean as I can make things. I can then export the data for...
Records: 4 Duplicates: 0 Warnings: 0 mysq1> select * from user_bak; //回车看表里已经有数据内容 4 rows in set (0.00 sec) 3、使用 user_bak 表做实验,演示 delete 操作 mysql> begin; Query OK, 0 rows affected (0.00 sec) mysql> delete from user_bak; //delete 操作删除 user_bak Query...