create.result
来自「视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.」· RESULT 代码 · 共 1,266 行 · 第 1/5 页
RESULT
1,266 行
drop table if exists t1,t2,t3,t4,t5;drop database if exists mysqltest;create table t1 (b char(0));insert into t1 values (""),(null);select * from t1;bNULLdrop table if exists t1;create table t1 (b char(0) not null);create table if not exists t1 (b char(0) not null);Warnings:Note 1050 Table 't1' already existsinsert into t1 values (""),(null);Warnings:Warning 1048 Column 'b' cannot be nullselect * from t1;bdrop table t1;create table t1 (a int not null auto_increment,primary key (a)) engine=heap;drop table t1;create table t2 engine=heap select * from t1;ERROR 42S02: Table 'test.t1' doesn't existcreate table t2 select auto+1 from t1;ERROR 42S02: Table 'test.t1' doesn't existdrop table if exists t1,t2;Warnings:Note 1051 Unknown table 't1'Note 1051 Unknown table 't2'create table t1 (b char(0) not null, index(b));ERROR 42000: The used storage engine can't index column 'b'create table t1 (a int not null,b text) engine=heap;ERROR 42000: The used table type doesn't support BLOB/TEXT columnsdrop table if exists t1;Warnings:Note 1051 Unknown table 't1'create table t1 (ordid int(8) not null auto_increment, ord varchar(50) not null, primary key (ord,ordid)) engine=heap;ERROR 42000: Incorrect table definition; there can be only one auto column and it must be defined as a keycreate table not_existing_database.test (a int);ERROR 42000: Unknown database 'not_existing_database'create table `a/a` (a int);ERROR 42000: Incorrect table name 'a/a'create table `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa int);ERROR 42000: Incorrect table name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'create table a (`aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa` int);ERROR 42000: Identifier name 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' is too longcreate table t1 (a datetime default now());ERROR 42000: Invalid default value for 'a'create table t1 (a datetime on update now());ERROR HY000: Invalid ON UPDATE clause for 'a' columncreate table t1 (a int default 100 auto_increment);ERROR 42000: Invalid default value for 'a'create table t1 (a tinyint default 1000);ERROR 42000: Invalid default value for 'a'create table t1 (a varchar(5) default 'abcdef');ERROR 42000: Invalid default value for 'a'create table t1 (a varchar(5) default 'abcde');insert into t1 values();select * from t1;aabcdealter table t1 alter column a set default 'abcdef';ERROR 42000: Invalid default value for 'a'drop table t1;create table 1ea10 (1a20 int,1e int);insert into 1ea10 values(1,1);select 1ea10.1a20,1e+ 1e+10 from 1ea10;1a20 1e+ 1e+101 10000000001drop table 1ea10;create table t1 (t1.index int);drop table t1;drop database if exists mysqltest;Warnings:Note 1008 Can't drop database 'mysqltest'; database doesn't existcreate database mysqltest;create table mysqltest.$test1 (a$1 int, $b int, c$ int);insert into mysqltest.$test1 values (1,2,3);select a$1, $b, c$ from mysqltest.$test1;a$1 $b c$1 2 3create table mysqltest.test2$ (a int);drop table mysqltest.test2$;drop database mysqltest;create table `` (a int);ERROR 42000: Incorrect table name ''drop table if exists ``;ERROR 42000: Incorrect table name ''create table t1 (`` int);ERROR 42000: Incorrect column name ''create table t1 (i int, index `` (i));ERROR 42000: Incorrect index name ''create table t1 (a int auto_increment not null primary key, B CHAR(20));insert into t1 (b) values ("hello"),("my"),("world");create table t2 (key (b)) select * from t1;explain select * from t2 where b="world";id select_type table type possible_keys key key_len ref rows Extra1 SIMPLE t2 ref B B 21 const 1 Using whereselect * from t2 where b="world";a B3 worlddrop table t1,t2;create table t1(x varchar(50) );create table t2 select x from t1 where 1=2;describe t1;Field Type Null Key Default Extrax varchar(50) YES NULL describe t2;Field Type Null Key Default Extrax varchar(50) YES NULL drop table t2;create table t2 select now() as a , curtime() as b, curdate() as c , 1+1 as d , 1.0 + 1 as e , 33333333333333333 + 3 as f;describe t2;Field Type Null Key Default Extraa datetime NO 0000-00-00 00:00:00 b time NO 00:00:00 c date NO 0000-00-00 d int(3) NO 0 e decimal(3,1) NO 0.0 f bigint(19) NO 0 drop table t2;create table t2 select CAST("2001-12-29" AS DATE) as d, CAST("20:45:11" AS TIME) as t, CAST("2001-12-29 20:45:11" AS DATETIME) as dt;describe t2;Field Type Null Key Default Extrad date YES NULL t time YES NULL dt datetime YES NULL drop table t1,t2;create table t1 (a tinyint);create table t2 (a int) select * from t1;describe t1;Field Type Null Key Default Extraa tinyint(4) YES NULL describe t2;Field Type Null Key Default Extraa int(11) YES NULL drop table if exists t2;create table t2 (a int, a float) select * from t1;ERROR 42S21: Duplicate column name 'a'drop table if exists t2;Warnings:Note 1051 Unknown table 't2'create table t2 (a int) select a as b, a+1 as b from t1;ERROR 42S21: Duplicate column name 'b'drop table if exists t2;Warnings:Note 1051 Unknown table 't2'create table t2 (b int) select a as b, a+1 as b from t1;ERROR 42S21: Duplicate column name 'b'drop table if exists t1,t2;Warnings:Note 1051 Unknown table 't2'CREATE TABLE t1 (a int not null);INSERT INTO t1 values (1),(2),(1);CREATE TABLE t2 (primary key(a)) SELECT * FROM t1;ERROR 23000: Duplicate entry '1' for key 1SELECT * from t2;ERROR 42S02: Table 'test.t2' doesn't existDROP TABLE t1;DROP TABLE IF EXISTS t2;Warnings:Note 1051 Unknown table 't2'create table t1 (a int not null, b int, primary key(a), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b), key (b));show create table t1;Table Create Tablet1 CREATE TABLE `t1` ( `a` int(11) NOT NULL, `b` int(11) default NULL, PRIMARY KEY (`a`), KEY `b` (`b`), KEY `b_2` (`b`), KEY `b_3` (`b`), KEY `b_4` (`b`), KEY `b_5` (`b`), KEY `b_6` (`b`), KEY `b_7` (`b`), KEY `b_8` (`b`), KEY `b_9` (`b`), KEY `b_10` (`b`), KEY `b_11` (`b`), KEY `b_12` (`b`), KEY `b_13` (`b`), KEY `b_14` (`b`), KEY `b_15` (`b`), KEY `b_16` (`b`), KEY `b_17` (`b`), KEY `b_18` (`b`), KEY `b_19` (`b`), KEY `b_20` (`b`), KEY `b_21` (`b`), KEY `b_22` (`b`), KEY `b_23` (`b`), KEY `b_24` (`b`), KEY `b_25` (`b`), KEY `b_26` (`b`), KEY `b_27` (`b`), KEY `b_28` (`b`), KEY `b_29` (`b`), KEY `b_30` (`b`), KEY `b_31` (`b`)) ENGINE=MyISAM DEFAULT CHARSET=latin1drop table t1;create table t1 select if(1,'1','0'), month("2002-08-02");drop table t1;create table t1 select if('2002'='2002','Y','N');select * from t1;if('2002'='2002','Y','N')Ydrop table if exists t1;SET SESSION storage_engine="heap";SELECT @@storage_engine;@@storage_engineMEMORYCREATE TABLE t1 (a int not null);show create table t1;Table Create Tablet1 CREATE TABLE `t1` ( `a` int(11) NOT NULL) ENGINE=MEMORY DEFAULT CHARSET=latin1drop table t1;SET SESSION storage_engine="gemini";ERROR 42000: Unknown table engine 'gemini'SELECT @@storage_engine;@@storage_engineMEMORYCREATE TABLE t1 (a int not null);show create table t1;Table Create Tablet1 CREATE TABLE `t1` ( `a` int(11) NOT NULL) ENGINE=MEMORY DEFAULT CHARSET=latin1SET SESSION storage_engine=default;drop table t1;create table t1 ( k1 varchar(2), k2 int, primary key(k1,k2));insert into t1 values ("a", 1), ("b", 2);insert into t1 values ("c", NULL);ERROR 23000: Column 'k2' cannot be nullinsert into t1 values (NULL, 3);ERROR 23000: Column 'k1' cannot be nullinsert into t1 values (NULL, NULL);ERROR 23000: Column 'k1' cannot be nulldrop table t1;create table t1 select x'4132';drop table t1;create table t1 select 1,2,3;create table if not exists t1 select 1,2;Warnings:Note 1050 Table 't1' already existscreate table if not exists t1 select 1,2,3,4;ERROR 21S01: Column count doesn't match value count at row 1create table if not exists t1 select 1;Warnings:
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?