mysql> insert into t2 values(2, 'henry', null);
ERROR 1062 (23000): Duplicate entry '2-henry' for key
mysql> insert into t2 values(2, '', null);
Query OK, 1 row affected (0.00 sec)
mysql> insert into t2 values(2, null, null);
ERROR 1048 (23000): Column 'name' cannot be null
mysql> insert into t2 values(null, '', null);
ERROR 1048 (23000): Column 'id' cannot be null
mysql> select * from t2;
+----+-------+------+
| id | name | sex
+----+-------+------+
| 1 | henry | NULL
| 2 | henry | NULL
| 2 | | NULL
+----+-------+------+
3 rows in set (0.00 sec)
mysql>

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑