Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Specify Default Values in INSERT Statement
How To Specify Default Values in INSERT Statement? - MySQL FAQs - Understanding SQL INSERT, UPDATE and DELETE Statements
✍: 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)
2007-05-11, 4783👍, 0💬
Popular Posts:
What are the two fundamental objects in ADO.NET ? Datareader and Dataset are the two fundamental obj...
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
Is Session_End event supported in all session modes ? Session_End event occurs only in “Inproc mode”...
What Are the Parameter Modes Supported by PL/SQL? - Oracle DBA FAQ - Creating Your Own PL/SQL Proced...
Can event’s have access modifiers ? Event’s are always public as they are meant to serve every one r...