标题:请教大家
只看楼主
faint_路漫漫
Rank: 1
等 级:新手上路
帖 子:30
专家分:0
注 册:2008-5-6
 问题点数:0 回复次数:0 
请教大家
mysql> alter table holiday
    -> modify customerid int not null;//约束为not null   
Query OK, 2 rows affected (0.06 sec)
Records: 2  Duplicates: 0  Warnings: 0

mysql> insert into holiday(bookingid,destination) values(3,'guangzhou');//为什么这里还能输入为NULL;请高手帮助。。。。。谢谢`~`
Query OK, 1 row affected, 1 warning (0.00 sec)

mysql> select *from holiday;
+------------+-----------+-------------+
| customerid | bookingid | destination |
+------------+-----------+-------------+
|          1 |         1 | beijing     |
|          0 |         1 | shanghai    |
|          0 |         3 | guangzhou   |
+------------+-----------+-------------+
3 rows in set (0.00 sec)

mysql>
2008-05-07 20:44



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-213045-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.359448 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved