sqlite database default time value 'now'

前端 未结 7 1502
温柔的废话
温柔的废话 2020-11-27 09:28

Is it possible in a sqlite database to craete a table that has a timestamp column that default to DATETIME(\'now\') ?

Like this:

CREATE          


        
7条回答
  •  一生所求
    2020-11-27 10:23

    It's just a syntax error, you need parenthesis: (DATETIME('now'))

    If you look at the documentation, you'll note the parenthesis that is added around the 'expr' option in the syntax.

提交回复
热议问题