How to set attribute to its default value

Viewed 46

I'm looking for a way to update a record attribute with its default value (the one that's defined in the DEFAULT statement), without specifying the value explicitly in the UPDATE statement.
Pls help.

1 Answers

You can update to DEFAULT if there is a default specified in the schema definition for that column.

For example:

update mytable set mycol=default where id=1;
Related