I have a table like this:
create table1 (field1 int,
field2 int default 5557,
field3 int default 1337,
field4 i
The best way is:
insert your_table
default values
Just don't include the columns that you want to use the default value for in your insert statement. For instance:
INSERT INTO table1 (field1, field3) VALUES (5, 10);
...will take the default values for field2
and field4
, and assign 5 to field1
and 10 to field3
.