Collections:
Using Column Default Values in MySQL
How To Specify Default Values in INSERT Statement in MySQL?
✍: FYIcenter.com
If a column is defined with a default value in a table, you can use the key word DEFAULT in the INSERT statement to take the default value for that column. The following tutorial exercise gives a good example:
mysql> INSERT INTO fyi_links VALUES (102, 'dba.fyicenter.com', NULL, 0, DEFAULT); Query OK, 1 row affected, 1 warning (0.01 sec) mysql> SELECT id, url, notes, counts, DATE(created) FROM fyi_links; +-----+-------------------+-------+--------+---------------+ | id | url | notes | counts | DATE(created) | +-----+-------------------+-------+--------+---------------+ | 101 | dev.fyicenter.com | NULL | 0 | 2006-04-30 | | 102 | dba.fyicenter.com | NULL | 0 | 2006-07-01 | +-----+-------------------+-------+--------+---------------+ 2 rows in set (0.00 sec)
⇒ Omitting Columns in INSERT Statements in MySQL
⇐ Inserting a New Row into a Table in MySQL
2018-01-16, 1755🔥, 0💬
Popular Posts:
How To Create a Dynamic Cursor with the DYNAMIC Option in SQL Server Transact-SQL? If the underlying...
Is PL/SQL Language Case Sensitive in Oracle? PL/SQL language is not case sensitive: Reserved words a...
How To Calculate Age in Days, Hours and Minutes in SQL Server Transact-SQL? On many Web sites, news ...
What Happens If the UPDATE Subquery Returns Multiple Rows in MySQL? If a subquery is used in a UPDAT...
What Is a Parameter File in Oracle? A parameter file is a file that contains a list of initializatio...