How to insert default values in SQL table?

前端 未结 8 961
灰色年华
灰色年华 2020-11-28 06:26

I have a table like this:

create table1 (field1 int,
               field2 int default 5557,
               field3 int default 1337, 
               field4 i         


        
8条回答
  •  星月不相逢
    2020-11-28 07:01

    To insert the default values you should omit them something like this :

    Insert into Table (Field2) values(5)
    

    All other fields will have null or their default values if it has defined.

提交回复
热议问题