range.result

来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 1,138 行 · 第 1/3 页

RESULT
1,138
字号
delete from t2;insert into t2(uid, name) values (1, CHAR(64+1)),(2, CHAR(64+2)),(3, CHAR(64+3)),(4, CHAR(64+4)),(5, CHAR(64+5)),(6, CHAR(64+6)),(7, CHAR(64+7)),(8, CHAR(64+8)),(9, CHAR(64+9)),(10, CHAR(64+10)),(11, CHAR(64+11)),(12, CHAR(64+12)),(13, CHAR(64+13)),(14, CHAR(64+14)),(15, CHAR(64+15)),(16, CHAR(64+16)),(17, CHAR(64+17)),(18, CHAR(64+18)),(19, CHAR(64+19)),(20, CHAR(64+20)),(21, CHAR(64+21)),(22, CHAR(64+22)),(23, CHAR(64+23)),(24, CHAR(64+24)),(25, CHAR(64+25)),(26, CHAR(64+26));insert into t1(uid, name) select uid, name from t2;delete from t2;insert into t2(id, uid, name) select id, uid, name from t1;select count(*) from t1;count(*)1026select count(*) from t2;count(*)1026analyze table t1,t2;Table	Op	Msg_type	Msg_texttest.t1	analyze	status	OKtest.t2	analyze	status	Table is already up to dateexplain select * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	112	Using where1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	38	explain select * from t1, t2  where t1.uid=t2.uid AND t2.uid > 0;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	112	Using where1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	38	explain select * from t1, t2  where t1.uid=t2.uid AND t1.uid != 0;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	113	Using where1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	38	explain select * from t1, t2  where t1.uid=t2.uid AND t2.uid != 0;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	uid_index	uid_index	4	NULL	113	Using where1	SIMPLE	t2	ref	uid_index	uid_index	4	test.t1.uid	38	select * from t1, t2  where t1.uid=t2.uid AND t1.uid > 0;id	name	uid	id	name	uid1001	A	1	1001	A	11002	B	2	1002	B	21003	C	3	1003	C	31004	D	4	1004	D	41005	E	5	1005	E	51006	F	6	1006	F	61007	G	7	1007	G	71008	H	8	1008	H	81009	I	9	1009	I	91010	J	10	1010	J	101011	K	11	1011	K	111012	L	12	1012	L	121013	M	13	1013	M	131014	N	14	1014	N	141015	O	15	1015	O	151016	P	16	1016	P	161017	Q	17	1017	Q	171018	R	18	1018	R	181019	S	19	1019	S	191020	T	20	1020	T	201021	U	21	1021	U	211022	V	22	1022	V	221023	W	23	1023	W	231024	X	24	1024	X	241025	Y	25	1025	Y	251026	Z	26	1026	Z	26select * from t1, t2  where t1.uid=t2.uid AND t1.uid != 0;id	name	uid	id	name	uid1001	A	1	1001	A	11002	B	2	1002	B	21003	C	3	1003	C	31004	D	4	1004	D	41005	E	5	1005	E	51006	F	6	1006	F	61007	G	7	1007	G	71008	H	8	1008	H	81009	I	9	1009	I	91010	J	10	1010	J	101011	K	11	1011	K	111012	L	12	1012	L	121013	M	13	1013	M	131014	N	14	1014	N	141015	O	15	1015	O	151016	P	16	1016	P	161017	Q	17	1017	Q	171018	R	18	1018	R	181019	S	19	1019	S	191020	T	20	1020	T	201021	U	21	1021	U	211022	V	22	1022	V	221023	W	23	1023	W	231024	X	24	1024	X	241025	Y	25	1025	Y	251026	Z	26	1026	Z	26drop table t1,t2;create table t1 (x bigint unsigned not null);insert into t1(x) values (0xfffffffffffffff0);insert into t1(x) values (0xfffffffffffffff1);select * from t1;x1844674407370955160018446744073709551601select count(*) from t1 where x>0;count(*)2select count(*) from t1 where x=0;count(*)0select count(*) from t1 where x<0;count(*)0select count(*) from t1 where x < -16;count(*)0select count(*) from t1 where x = -16;count(*)0select count(*) from t1 where x > -16;count(*)2select count(*) from t1 where x = 18446744073709551601;count(*)1create table t2 (x bigint not null);insert into t2(x) values (-16);insert into t2(x) values (-15);select * from t2;x-16-15select count(*) from t2 where x>0;count(*)0select count(*) from t2 where x=0;count(*)0select count(*) from t2 where x<0;count(*)2select count(*) from t2 where x < -16;count(*)0select count(*) from t2 where x = -16;count(*)1select count(*) from t2 where x > -16;count(*)1select count(*) from t2 where x = 18446744073709551601;count(*)0drop table t1,t2;create table t1 (x bigint unsigned not null primary key) engine=innodb;insert into t1(x) values (0xfffffffffffffff0);insert into t1(x) values (0xfffffffffffffff1);select * from t1;x1844674407370955160018446744073709551601select count(*) from t1 where x>0;count(*)2select count(*) from t1 where x=0;count(*)0select count(*) from t1 where x<0;count(*)0select count(*) from t1 where x < -16;count(*)0select count(*) from t1 where x = -16;count(*)0select count(*) from t1 where x > -16;count(*)2select count(*) from t1 where x = 18446744073709551601;count(*)1drop table t1;create table t1 (a bigint unsigned);create index t1i on t1(a);insert into t1 select 18446744073709551615;insert into t1 select 18446744073709551614;explain select * from t1 where a <> -1;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	index	t1i	t1i	9	NULL	2	Using where; Using indexselect * from t1 where a <> -1;a1844674407370955161418446744073709551615explain select * from t1 where a > -1 or a < -1;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	index	t1i	t1i	9	NULL	2	Using where; Using indexselect * from t1 where a > -1 or a < -1;a1844674407370955161418446744073709551615explain select * from t1 where a > -1;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	index	t1i	t1i	9	NULL	2	Using where; Using indexselect * from t1 where a > -1;a1844674407370955161418446744073709551615explain select * from t1 where a < -1;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	Impossible WHERE noticed after reading const tablesselect * from t1 where a < -1;adrop table t1;set names latin1;create table t1 (a char(10), b text, key (a)) character set latin1;INSERT INTO t1 (a) VALUES('111'),('222'),('222'),('222'),('222'),('444'),('aaa'),('AAA'),('bbb');explain select * from t1 where a='aaa';id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	ref	a	a	11	const	2	Using whereexplain select * from t1 where a=binary 'aaa';id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	a	a	11	NULL	2	Using whereexplain select * from t1 where a='aaa' collate latin1_bin;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	a	a	11	NULL	2	Using whereexplain select * from t1 where a='aaa' collate latin1_german1_ci;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	ALL	a	NULL	NULL	NULL	9	Using wheredrop table t1;CREATE TABLE t1 (`CLIENT` char(3) character set latin1 collate latin1_bin NOT NULL default '000',`ARG1` char(3) character set latin1 collate latin1_bin NOT NULL default '',`ARG2` char(3) character set latin1 collate latin1_bin NOT NULL default '',`FUNCTION` varchar(10) character set latin1 collate latin1_bin NOT NULL default '',`FUNCTINT` int(11) NOT NULL default '0',KEY `VERI_CLNT~2` (`ARG1`)) ENGINE=InnoDB DEFAULT CHARSET=latin1;INSERT INTO t1 VALUES ('000',' 0',' 0','Text 001',0), ('000',' 0',' 1','Text 002',0),('000',' 1',' 2','Text 003',0), ('000',' 2',' 3','Text 004',0),('001',' 3',' 0','Text 017',0);SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');count(*)4SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');count(*)4drop table t1;create table t1 (a int);insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);CREATE TABLE t2 (pk1 int(11) NOT NULL,pk2 int(11) NOT NULL,pk3 int(11) NOT NULL,pk4 int(11) NOT NULL,filler char(82),PRIMARY KEY (pk1,pk2,pk3,pk4)) DEFAULT CHARSET=latin1;insert into t2 select 1, A.a+10*B.a, 432, 44, 'fillerZ' from t1 A, t1 B;INSERT INTO t2 VALUES (2621, 2635, 0, 0,'filler'), (2621, 2635, 1, 0,'filler'),(2621, 2635, 10, 0,'filler'), (2621, 2635, 11, 0,'filler'),(2621, 2635, 14, 0,'filler'), (2621, 2635, 1000015, 0,'filler');SELECT * FROM t2WHERE ((((pk4 =0) AND (pk1 =2621) AND (pk2 =2635)))OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))))) AND (pk3 >=1000000);pk1	pk2	pk3	pk4	filler2621	2635	1000015	0	fillerdrop table t1, t2;create table t1(a char(2), key(a(1)));insert into t1 values ('x'), ('xx');explain select a from t1 where a > 'x';id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	t1	range	a	a	2	NULL	2	Using whereselect a from t1 where a > 'x';axxdrop table t1;CREATE TABLE t1 (OXID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',OXPARENTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT 'oxrootid',OXLEFT int NOT NULL DEFAULT '0',OXRIGHT int NOT NULL DEFAULT '0',OXROOTID varchar(32) COLLATE latin1_german2_ci NOT NULL DEFAULT '',PRIMARY KEY  (OXID),KEY OXNID (OXID),KEY OXLEFT (OXLEFT),KEY OXRIGHT (OXRIGHT),KEY OXROOTID (OXROOTID)) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_german2_ci;INSERT INTO t1 VALUES('d8c4177d09f8b11f5.52725521','oxrootid',1,40,'d8c4177d09f8b11f5.52725521'),('d8c4177d151affab2.81582770','d8c4177d09f8b11f5.52725521',2,3,'d8c4177d09f8b11f5.52725521'),('d8c4177d206a333d2.74422679','d8c4177d09f8b11f5.52725521',4,5,'d8c4177d09f8b11f5.52725521'),('d8c4177d225791924.30714720','d8c4177d09f8b11f5.52725521',6,7,'d8c4177d09f8b11f5.52725521'),('d8c4177d2380fc201.39666693','d8c4177d09f8b11f5.52725521',8,9,'d8c4177d09f8b11f5.52725521'),('d8c4177d24ccef970.14957924','d8c4177d09f8b11f5.52725521',10,11,'d8c4177d09f8b11f5.52725521');EXPLAINSELECT s.oxid FROM t1 v, t1 s WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' ANDv.oxrootid ='d8c4177d09f8b11f5.52725521' ANDs.oxleft > v.oxleft AND s.oxleft < v.oxright;id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra1	SIMPLE	v	ref	OXLEFT,OXRIGHT,OXROOTID	OXROOTID	34	const	5	Using where1	SIMPLE	s	ALL	OXLEFT	NULL	NULL	NULL	5	Range checked for each record (index map: 0x4)SELECT s.oxid FROM t1 v, t1 s WHERE s.oxrootid = 'd8c4177d09f8b11f5.52725521' ANDv.oxrootid ='d8c4177d09f8b11f5.52725521' ANDs.oxleft > v.oxleft AND s.oxleft < v.oxright;oxidd8c4177d151affab2.81582770d8c4177d206a333d2.74422679d8c4177d225791924.30714720d8c4177d2380fc201.39666693d8c4177d24ccef970.14957924DROP TABLE t1;create table t1 (c1  char(10), c2  char(10), c3  char(10), c4  char(10),c5  char(10), c6  char(10), c7  char(10), c8  char(10),c9  char(10), c10 char(10), c11 char(10), c12 char(10),c13 char(10), c14 char(10), c15 char(10), c16 char(10),index(c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12,c13,c14,c15,c16));insert into t1 (c1) values ('1'),('1'),('1'),('1');select * from t1 wherec1 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", "abcdefg1", "123456781", "qwertyui1", "asddfg1", "abcdefg2", "123456782", "qwertyui2", "asddfg2", "abcdefg3", "123456783", "qwertyui3", "asddfg3", "abcdefg4", "123456784", "qwertyui4", "asddfg4","abcdefg5", "123456785", "qwertyui5", "asddfg5","abcdefg6", "123456786", "qwertyui6", "asddfg6","abcdefg7", "123456787", "qwertyui7", "asddfg7","abcdefg8", "123456788", "qwertyui8", "asddfg8","abcdefg9", "123456789", "qwertyui9", "asddfg9","abcdefgA", "12345678A", "qwertyuiA", "asddfgA","abcdefgB", "12345678B", "qwertyuiB", "asddfgB","abcdefgC", "12345678C", "qwertyuiC", "asddfgC")and c2 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", "abcdefg1", "123456781", "qwertyui1", "asddfg1", "abcdefg2", "123456782", "qwertyui2", "asddfg2", "abcdefg3", "123456783", "qwertyui3", "asddfg3", "abcdefg4", "123456784", "qwertyui4", "asddfg4", "abcdefg5", "123456785", "qwertyui5", "asddfg5","abcdefg6", "123456786", "qwertyui6", "asddfg6","abcdefg7", "123456787", "qwertyui7", "asddfg7","abcdefg8", "123456788", "qwertyui8", "asddfg8","abcdefg9", "123456789", "qwertyui9", "asddfg9","abcdefgA", "12345678A", "qwertyuiA", "asddfgA","abcdefgB", "12345678B", "qwertyuiB", "asddfgB","abcdefgC", "12345678C", "qwertyuiC", "asddfgC")and c3 in ("abcdefgh", "123456789", "qwertyuio", "asddfgh", "abcdefg1", "123456781", "qwertyui1", "asddfg1", "abcdefg2", "123456782", "qwertyui2", "asddfg2", "abcdefg3", "123456783", "qwertyui3", "asddfg3", "abcdefg4", "123456784", "qwertyui4", "asddfg4", "abcdefg5", "123456785", "qwertyui5", "asddfg5",

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?