📄 func_group.result
字号:
XXX NULL MIN NULL NULLWWW 1 LED NULL NULLselect * from t2;a1 a2 a3 a4TKF Seattle WA AMELCC Los Angeles CA TWUDEN Denver CO BDLSDC San Diego CA TWUNOL New Orleans LA GTMLAK Los Angeles CA TWUAAA AAA AA AMEexplain select min(a1) from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a1) from t1;min(a1)AMEexplain select max(a4) from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a4) from t1;max(a4)0.1explain select min(a5), max(a5) from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a5), max(a5) from t1;min(a5) max(a5)1942-02-19 1977-09-23explain select min(a3) from t1 where a2 = 2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where a2 = 2;min(a3)CHIexplain select min(a1), max(a1) from t1 where a4 = 0.080;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a1), max(a1) from t1 where a4 = 0.080;min(a1) max(a1)BDL TWUexplain select min(t1.a5), max(t2.a3) from t1, t2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(t1.a5), max(t2.a3) from t1, t2;min(t1.a5) max(t2.a3)1942-02-19 WAexplain select min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(t1.a3), max(t2.a2) from t1, t2 where t1.a2 = 0 and t2.a3 = 'CA';min(t1.a3) max(t2.a2)DEN San Diegoexplain select min(a1) from t1 where a1 > 'KKK';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a1) from t1 where a1 > 'KKK';min(a1)PLSexplain select min(a1) from t1 where a1 >= 'KKK';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a1) from t1 where a1 >= 'KKK';min(a1)KKKexplain select max(a3) from t1 where a2 = 2 and a3 < 'SEA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a2 = 2 and a3 < 'SEA';max(a3)MINexplain select max(a5) from t1 where a5 < date'1970-01-01';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a5) from t1 where a5 < date'1970-01-01';max(a5)1969-10-05explain select max(a3) from t1 where a2 is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a2 is null;max(a3)MINexplain select max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a2 = 0 and a3 between 'K' and 'Q';max(a3)LAXexplainselect min(a1), max(a1) from t1 where a1 between 'A' and 'P';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a1), max(a1) from t1 where a1 between 'A' and 'P';min(a1) max(a1)AME KKKexplain select max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a3 < 'SEA' and a2 = 2 and a3 <= 'MIN';max(a3)MINexplain select max(a3) from t1 where a3 = 'MIN' and a2 = 2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a3 = 'MIN' and a2 = 2;max(a3)MINexplain select max(a3) from t1 where a3 = 'DEN' and a2 = 2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max rowselect max(a3) from t1 where a3 = 'DEN' and a2 = 2;max(a3)NULLexplainselect max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 = 'CA';max(t1.a3) min(t2.a2)CHI Los Angelesexplainselect max(a3) from t1 where a2 is null and a2 = 2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHEREselect max(a3) from t1 where a2 is null and a2 = 2;max(a3)NULLexplainselect max(a2) from t1 where a2 >= 1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a2) from t1 where a2 >= 1;max(a2)3explainselect min(a3) from t1 where a2 = 2 and a3 < 'SEA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where a2 = 2 and a3 < 'SEA';min(a3)CHIexplainselect min(a3) from t1 where a2 = 4;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max rowselect min(a3) from t1 where a2 = 4;min(a3)NULLexplainselect min(a3) from t1 where a2 = 2 and a3 > 'SEA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max rowselect min(a3) from t1 where a2 = 2 and a3 > 'SEA';min(a3)NULLexplainselect (min(a4)+max(a4))/2 from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect (min(a4)+max(a4))/2 from t1;(min(a4)+max(a4))/20.085explainselect min(a3) from t1 where 2 = a2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where 2 = a2;min(a3)CHIexplainselect max(a3) from t1 where a2 = 2 and 'SEA' > a3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect max(a3) from t1 where a2 = 2 and 'SEA' > a3;max(a3)MINexplainselect max(a3) from t1 where a2 = 2 and 'SEA' < a3;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL No matching min/max rowselect max(a3) from t1 where a2 = 2 and 'SEA' < a3;max(a3)NULLexplainselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI';min(a3)CHIexplainselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 < 'SEA';min(a3)CHIexplainselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(a3) from t1 where a2 = 2 and a3 >= 'CHI' and a3 = 'MIN';min(a3)MINexplainselect min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHEREselect min(a3) from t1 where a2 = 2 and a3 >= 'SEA' and a3 = 'MIN';min(a3)NULLexplainselect min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized awayselect min(t1.a1), min(t2.a4) from t1,t2 where t1.a1 < 'KKK' and t2.a4 < 'KKK';min(t1.a1) min(t2.a4)AME AMEexplain select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using indexexplain select min(a1) from t1 where a1 != 'KKK';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using indexexplainselect max(a3) from t1 where a2 < 2 and a3 < 'SEA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 range k1 k1 3 NULL 6 Using where; Using indexexplainselect max(t1.a3), min(t2.a2) from t1, t2 where t1.a2 = 2 and t1.a3 < 'MIN' and t2.a3 > 'CA';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 range k1 k1 7 NULL 1 Using where; Using index1 SIMPLE t2 range k1 k1 3 NULL 4 Using where; Using indexexplainselect min(a4 - 0.01) from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k2 12 NULL 15 Using indexexplainselect max(a4 + 0.01) from t1;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k2 12 NULL 15 Using indexexplainselect min(a3) from t1 where (a2 +1 ) is null;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using indexexplainselect min(a3) from t1 where (a2 + 1) = 2;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using indexexplainselect min(a3) from t1 where 2 = (a2 + 1);id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using indexexplainselect min(a2) from t1 where a2 < 2 * a2 - 8;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k1 7 NULL 15 Using where; Using indexexplainselect min(a1) from t1 where a1 between a3 and 'KKK';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 15 Using whereexplainselect min(a4) from t1 where (a4 + 0.01) between 0.07 and 0.08;id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t1 index NULL k2 12 NULL 15 Using where; Using indexexplainselect concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME';id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 Using indexdrop table t1, t2;create table t1 (USR_ID integer not null, MAX_REQ integer not null, constraint PK_SEA_USER primary key (USR_ID)) engine=InnoDB;insert into t1 values (1, 3);select count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ from t1 group by MAX_REQ;count(*) + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ + MAX_REQ - MAX_REQ1select Case When Count(*) < MAX_REQ Then 1 Else 0 End from t1 where t1.USR_ID = 1 group by MAX_REQ;Case When Count(*) < MAX_REQ Then 1 Else 0 End1drop table t1;create table t1 (a char(10));insert into t1 values ('a'),('b'),('c');select coercibility(max(a)) from t1;coercibility(max(a))2drop table t1;create table t1 (a char character set latin2);insert into t1 values ('a'),('b');select charset(max(a)), coercibility(max(a)),charset(min(a)), coercibility(min(a)) from t1;charset(max(a)) coercibility(max(a)) charset(min(a)) coercibility(min(a))latin2 2 latin2 2show create table t1;Table Create Tablet1 CREATE TABLE `t1` ( `a` char(1) character set latin2 default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1create table t2 select max(a),min(a) from t1;show create table t2;Table Create Tablet2 CREATE TABLE `t2` ( `max(a)` char(1) character set latin2 default NULL, `min(a)` char(1) character set latin2 default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1drop table t2;create table t2 select concat(a) from t1;show create table t2;Table Create Tablet2 CREATE TABLE `t2` ( `concat(a)` varchar(1) character set latin2 default NULL) ENGINE=MyISAM DEFAULT CHARSET=latin1drop table t2,t1;create table t1 (a int);insert into t1 values (1);select max(a) as b from t1 having b=1;b1select a from t1 having a=1;a1drop table t1;create table t1 (a int);select variance(2) from t1;variance(2)NULLselect stddev(2) from t1;stddev(2)NULLdrop table t1;create table t1 (a int);insert into t1 values (1),(2);prepare stmt1 from 'SELECT COUNT(*) FROM t1';execute stmt1;COUNT(*)2execute stmt1;COUNT(*)2execute stmt1;COUNT(*)2deallocate prepare stmt1;drop table t1;create table t1 (a int, primary key(a));insert into t1 values (1),(2);prepare stmt1 from 'SELECT max(a) FROM t1';
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -