- 博客(1)
- 收藏
- 关注
原创 MySQL 非空约束设置的几种语句
添加非空约束1、如果是在建表时直接添加,可使用下面的SQL语句:create table t_user(user_id int(10)not null);2、也可以在建表之后通过alter语句创建。alter table t_user modify user_id int(10) not null;或者 alter table t_user change user_id user_id int(10) not null;这里要注意,使用change的时候后面跟的字段名要写两遍的,不然
2021-10-04 12:32:48
3577
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人