【发布时间】:2012-02-06 23:52:51
【问题描述】:
sqlite 中是否有强制转换,我需要它在创建表定义中工作...
....
mydatetime numeric not null DEFAULT (strftime('%Y%m%d%H%M','now', 'localtime')) );
谢谢
【问题讨论】:
标签: sqlite casting create-table
sqlite 中是否有强制转换,我需要它在创建表定义中工作...
....
mydatetime numeric not null DEFAULT (strftime('%Y%m%d%H%M','now', 'localtime')) );
谢谢
【问题讨论】:
标签: sqlite casting create-table
sqlite> .headers on
sqlite> CREATE TABLE t1 (mydatetime int not null DEFAULT (strftime('%Y%m%d%H%M',
'now', 'localtime')), otherval TEXT);
sqlite>
sqlite> INSERT INTO t1 (otherval) VALUES ('qwe');
sqlite> SELECT * FROM t1;
mydatetime|otherval
201201231947|qwe
【讨论】: