亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

請問一下在mysql中的 COMMENT 有什么作用嗎??

請問一下在mysql中的 COMMENT 有什么作用嗎??

繁星淼淼 2019-10-28 10:06:19
mysql中的 COMMENT 有什么作用嗎?
查看完整描述

3 回答

?
翻閱古今

TA貢獻1780條經驗 獲得超5個贊

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)

查看完整回答
反對 回復 2019-11-16
?
天涯盡頭無女友

TA貢獻1831條經驗 獲得超9個贊

字段的注釋信息。

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;


查看完整回答
反對 回復 2019-11-16
  • 3 回答
  • 0 關注
  • 2018 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號