编程论坛's Archiver

faint_路漫漫 发表于 2008-5-7 20:44

请教大家

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>

页: [1]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.