首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > Mysql >

mysql5中,alter table中对列的允许空与非空的修改!解决方法

2012-02-17 
mysql5中,alter table中对列的允许空与非空的修改!我想把a这一列修改成不允许为空(它原来是允许为空的)!al

mysql5中,alter table中对列的允许空与非空的修改!
我想把a这一列修改成不允许为空(它原来是允许为空的)!
alter table tb_name alter column a char(8) not null;
为什么总提示错误呢?

[解决办法]

SQL code
alter   table   tb_name   modify  a   char(8)   not   null;
[解决办法]
SQL code
create unique index f_a on tbl_name(a); 

热点排行