首页 > 其他 > 详细

not null 非空约束

时间:2018-06-13 21:31:34      阅读:166      评论:0      收藏:0      [点我收藏+]

例子:
create table tb1(
     id int,
     name varchar(20) not null
);

 

注意  空字符不等于null


#手动,添加非空约束
(必须这个字段,没有NULL值)
mysql> alter table tb1
    -> modify id int not null;

# 取消非空约束
mysql> alter table tb1
    -> modify id int ;

 

not null 非空约束

原文:https://www.cnblogs.com/mariobear/p/9180012.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!