How to create a datetime column with default value in sqlite3?

前端 未结 4 1127
甜味超标
甜味超标 2020-12-23 02:03

Is there a way to create a table in sqlite3 that has a datetime column that defaults to \'now\'?

The following statement returns a syntax error:

crea         


        
4条回答
  •  悲哀的现实
    2020-12-23 02:34

    you can use the following query for using current date value in your table

    create table tablename (date_field_name Created_on default CURRENT_DATE);
    

提交回复
热议问题