Insert statement with set statement and default value : Default : Insert Update Delete MySQL TUTORIALS


MySQL TUTORIALS » Insert Update Delete » Default »

 

Insert statement with set statement and default value


mysql>
mysql> CREATE TABLE myTable(
    ->    ID TINYINT UNSIGNED NOT NULL DEFAULT 1,
    ->    Name VARCHAR(50NOT NULL
    -> );
Query OK, rows affected (0.03 sec)

mysql>
mysql>
mysql> INSERT DELAYED INTO myTable SET ID=DEFAULT, Name='C';
Query OK, row affected (0.02 sec)

mysql>
mysql> select from myTable;
+----+------+
| ID | Name |
+----+------+
|  | C    |
+----+------+
row in set (0.00 sec)

mysql>
mysql> drop table myTable;
Query OK, rows affected (0.01 sec)

mysql>
mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Insert Update Delete
» Default