MySQL建表两个单引号报错_极客起源 - geekori.com - 问题详情 - mysql建表报错,查手册看不懂,求解?...
創建帶索引的數據庫表需要為表名和屬性添加反單引號,并且你當前的primary key的位置需要調整一下:
create table `abc`(
`id` int unsigned auto_increment,
`usename` char(20) not null default '',
`gender` char(1) not null default '',
`weight` tinyint unsigned not null default 0,
`birth` date not null default 0,
`salary` decimal(8,2) not null default '000000.00',
`lastlogin` timestamp not null default 0,
`intro` varchar(1500) not null default '',
primary key (`id`)
)engine myisam charset=utf8;
我剛剛試了一下,除了primary key其他的屬性和表名不加反單引號也可以,即這樣也是可以的:
create table abc(
id int unsigned auto_increment,
usename char(20) not null default '',
gender char(1) not null default '',
weight tinyint unsigned not null default 0,
birth date not null default 0,
salary decimal(8,2) not null default '000000.00',
lastlogin timestamp not null default 0,
intro varchar(1500) not null default '',
primary key (`id`)
)engine myisam charset=utf8;
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的MySQL建表两个单引号报错_极客起源 - geekori.com - 问题详情 - mysql建表报错,查手册看不懂,求解?...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: oracle 的跨天查询,考勤跨天如何统
- 下一篇: java 多重注解_Java注解-元数据