MySQL建表两个单引号报错_极客起源 - geekori.com - 问题详情 - mysql建表报错,查手册看不懂,求解?...
創(chuàng)建帶索引的數(shù)據(jù)庫(kù)表需要為表名和屬性添加反單引號(hào),并且你當(dāng)前的primary key的位置需要調(diào)整一下:
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其他的屬性和表名不加反單引號(hào)也可以,即這樣也是可以的:
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;
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的MySQL建表两个单引号报错_极客起源 - geekori.com - 问题详情 - mysql建表报错,查手册看不懂,求解?...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: oracle 的跨天查询,考勤跨天如何统
- 下一篇: java 多重注解_Java注解-元数据
