请问一下在mysql中的 COMMENT 有什么作用吗??

mysql中的 COMMENT 有什么作用吗?


繁星淼淼
浏览 1819回答 3
3回答

翻阅古今

comment---备注说明的意思,如:create table tb_test(id int comment '该列作为记录号');就算你删除那部分,你的语句还是会有错的,因为mysql下auto_increment必须为key,改后如下:CREATE TABLE `hg_pay_exchange` (`id` int(10) unsigned NOT NULL AUTO_INCREMENT primary key COMMENT 'id',`module` varchar(15) NOT NULL,`type` enum('amount','point') NOT NULL,`number` decimal(8,2) NOT NULL)

天涯尽头无女友

字段的注释信息。1234567891011use test; show tables; create table if not exists test_user(    id int auto_increment primary key comment 'primay key',    username varchar(50) not null,    age smallint not null comment '年龄') engine=InnoDB default charset=utf8; show full columns from test_user;
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

MySQL
ZBrush