MySQL Tutorial/Table/Default
Версия от 13:44, 26 мая 2010; (обсуждение)
Using the default key word to insert value
mysql>
mysql>
mysql> CREATE TABLE Test(State char(2) NOT NULL DEFAULT "KY");
Query OK, 0 rows affected (0.03 sec)
mysql>
mysql> insert into Test (state) value (default);
Query OK, 1 row affected (0.01 sec)
mysql>
mysql> select * from Test;
+-------+
| State |
+-------+
| KY |
+-------+
1 row in set (0.02 sec)
mysql>
mysql> drop table Test;
Query OK, 0 rows affected (0.00 sec)
mysql>
mysql>