769
769
Field Type Null Key Default Extra
772
create TEMPORARY table t1 (
773
number bigint NOT NULL default '0',
774
cname char(15) NOT NULL default '',
775
carrier_id int NOT NULL default '0',
776
privacy int NOT NULL default '0',
777
last_mod_date timestamp NOT NULL,
778
last_mod_id int NOT NULL default '0',
779
last_app_date timestamp NULL,
780
last_app_id int default '-1',
781
version int NOT NULL default '0',
782
assigned_scps int default '0',
783
status int default '0'
785
INSERT INTO t1 VALUES (4077711111,'SeanWheeler',90,2,20020111112846,500,NULL,-1,2,3,1);
786
INSERT INTO t1 VALUES (9197722223,'berry',90,3,20020111112809,500,20020102114532,501,4,10,0);
787
INSERT INTO t1 VALUES (650,'San Francisco',0,0,20011227111336,342,NULL,-1,1,24,1);
788
INSERT INTO t1 VALUES (302467,'Sue\'s Subshop',90,3,20020109113241,500,20020102115111,501,7,24,0);
789
INSERT INTO t1 VALUES (6014911113,'SudzCarwash',520,1,20020102115234,500,20020102115259,501,33,32768,0);
790
INSERT INTO t1 VALUES (333,'tubs',99,2,20020109113440,501,20020109113440,500,3,10,0);
791
create TEMPORARY table t2 (
792
number bigint NOT NULL default '0',
793
cname char(15) NOT NULL default '',
794
carrier_id int NOT NULL default '0',
795
privacy int NOT NULL default '0',
796
last_mod_date timestamp NOT NULL,
797
last_mod_id int NOT NULL default '0',
798
last_app_date timestamp NULL,
799
last_app_id int default '-1',
800
version int NOT NULL default '0',
801
assigned_scps int default '0',
802
status int default '0'
804
INSERT INTO t2 VALUES (4077711111,'SeanWheeler',0,2,20020111112853,500,NULL,-1,2,3,1);
805
INSERT INTO t2 VALUES (9197722223,'berry',90,3,20020111112818,500,20020102114532,501,4,10,0);
806
INSERT INTO t2 VALUES (650,'San Francisco',90,0,20020109113158,342,NULL,-1,1,24,1);
807
INSERT INTO t2 VALUES (333,'tubs',99,2,20020109113453,501,20020109113453,500,3,10,0);
809
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
810
4077711111 SeanWheeler 90 2 2002-01-11 11:28:46 500 NULL -1 2 3 1
811
9197722223 berry 90 3 2002-01-11 11:28:09 500 2002-01-02 11:45:32 501 4 10 0
812
650 San Francisco 0 0 2001-12-27 11:13:36 342 NULL -1 1 24 1
813
302467 Sue's Subshop 90 3 2002-01-09 11:32:41 500 2002-01-02 11:51:11 501 7 24 0
814
6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
815
333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
817
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
818
4077711111 SeanWheeler 0 2 2002-01-11 11:28:53 500 NULL -1 2 3 1
819
9197722223 berry 90 3 2002-01-11 11:28:18 500 2002-01-02 11:45:32 501 4 10 0
820
650 San Francisco 90 0 2002-01-09 11:31:58 342 NULL -1 1 24 1
821
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
822
delete t1, t2 from t1 left join t2 on t1.number=t2.number where (t1.carrier_id=90 and t1.number=t2.number) or (t2.carrier_id=90 and t1.number=t2.number) or (t1.carrier_id=90 and t2.number is null);
824
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
825
6014911113 SudzCarwash 520 1 2002-01-02 11:52:34 500 2002-01-02 11:52:59 501 33 32768 0
826
333 tubs 99 2 2002-01-09 11:34:40 501 2002-01-09 11:34:40 500 3 10 0
828
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
829
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
831
number cname carrier_id privacy last_mod_date last_mod_id last_app_date last_app_id version assigned_scps status
832
333 tubs 99 2 2002-01-09 11:34:53 501 2002-01-09 11:34:53 500 3 10 0
834
772
create TEMPORARY table t1 (id int not null auto_increment, code int not null, name char(20) not null, primary key (id), key (code), unique (name)) engine=MyISAM;
836
774
SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
872
create TEMPORARY table t1 (n int, d int) engine=MyISAM;
873
create TEMPORARY table t2 (n int, d int) engine=MyISAM;
874
insert into t1 values(1,1),(1,2);
875
insert into t2 values(1,10),(2,20);
876
UPDATE t1,t2 SET t1.d=t2.d,t2.d=30 WHERE t1.n=t2.n;
886
create TEMPORARY table t1 (a varchar(10) not null) engine = MEMORY;
887
create TEMPORARY table t2 (b varchar(10) not null unique) engine=MyISAM;
888
select t1.a from t1,t2 where t1.a=t2.b;
891
create TEMPORARY table t1 (a int not null, b int, primary key (a)) engine = MyISAM;
892
create TEMPORARY table t2 (a int not null, b int, primary key (a)) engine = MyISAM;
893
insert into t1 values (10, 20);
894
insert into t2 values (10, 20);
895
update t1, t2 set t1.b = 150, t2.b = t1.b where t2.a = t1.a and t1.a = 10;
897
810
create TEMPORARY table t1 (a int not null primary key, b int not null, unique (b)) engine=MyISAM;
898
811
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
899
812
UPDATE t1 set a=a+100 where b between 2 and 3 and a < 1000;
912
create TEMPORARY table t1 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
913
create TEMPORARY table t2 (a int not null primary key, b int not null, key (b)) engine=MyISAM;
914
INSERT INTO t1 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9),(10,10),(11,11),(12,12);
915
INSERT INTO t2 values (1,1),(2,2),(3,3),(4,4),(5,5),(6,6),(7,7),(8,8),(9,9);
916
update t1,t2 set t1.a=t1.a+100;
931
update t1,t2 set t1.a=t1.a+100 where t1.a=101;
946
update t1,t2 set t1.b=t1.b+10 where t1.b=2;
961
update t1,t2 set t1.b=t1.b+2,t2.b=t1.b+10 where t1.b between 3 and 5 and t1.a=t2.a+100;
988
create TEMPORARY table t2 ( NEXT_T BIGINT NOT NULL PRIMARY KEY) ENGINE=MEMORY;
989
create TEMPORARY table t1 ( B_ID INTEGER NOT NULL PRIMARY KEY) ENGINE=MyISAM;
991
INSERT INTO t1 ( B_ID ) VALUES ( 1 );
992
INSERT INTO t2 ( NEXT_T ) VALUES ( 1 );
995
Warning 1196 Some non-transactional changed tables couldn't be rolled back
1000
create TEMPORARY table t1 ( pk int primary key, parent int not null, child int not null, index (parent) ) engine = MyISAM;
1001
insert into t1 values (1,0,4), (2,1,3), (3,2,1), (4,1,2);
1002
select distinct parent,child from t1 order by parent;
1009
825
create TEMPORARY table t1 (a int not null auto_increment primary key, b int, c int, key(c)) engine=MyISAM;
1010
826
create TEMPORARY table t2 (a int not null auto_increment primary key, b int) ENGINE = MEMORY;
1011
827
insert into t1 (b) values (null),(null),(null),(null),(null),(null),(null);
1074
create TEMPORARY table t1 ( c char(8) not null ) engine=MyISAM;
1075
insert into t1 values ('0'),('1'),('2'),('3'),('4'),('5'),('6'),('7'),('8'),('9');
1076
insert into t1 values ('A'),('B'),('C'),('D'),('E'),('F');
1077
alter table t1 add b char(8) not null;
1078
alter table t1 add a char(8) not null;
1079
alter table t1 add primary key (a,b,c);
1080
update t1 set a=c, b=c;
1081
create TEMPORARY table t2 (c char(8) not null, b char(8) not null, a char(8) not null, primary key(a,b,c)) engine=MyISAM;
1082
insert into t2 select * from t1;
1083
delete t1,t2 from t2,t1 where t1.a<'B' and t2.b=t1.b;
1085
890
SET AUTOCOMMIT=1;
1086
891
create TEMPORARY table t1 (a integer auto_increment primary key) engine=MyISAM;
1087
892
insert into t1 (a) values (NULL),(NULL);