On 24-11-2013 19:36, Petite Abeille wrote:

On Nov 24, 2013, at 7:10 PM, Valentin Davydov <sqlite-u...@soi.spb.ru> wrote:

Wait a second... and you'll get different value of datetime('now'). In this
sense datetime() is as deterministic as random(): it may give the same result
next invocation or may not, dependng on various circumstances not related to
the function itself.

Nah… in SQL… ‘now’ is supposed to be computed once per statement. And that’s 
all.



Then 3.7.11, on windows is wrong, luckily this works OK on 3.8.1

C:\temp>\util\sqlite3 test.sqlite3
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> update test set d=datetime('now');
sqlite> select d, count(*) from test group by d;
2013-11-25 11:53:40|94941
2013-11-25 11:53:41|164850
2013-11-25 11:53:42|152478
2013-11-25 11:53:43|156193
2013-11-25 11:53:44|160673
2013-11-25 11:53:45|172547
2013-11-25 11:53:46|163959
2013-11-25 11:53:47|166997
2013-11-25 11:53:48|170299
2013-11-25 11:53:49|170700
2013-11-25 11:53:50|173197
2013-11-25 11:53:51|171121
2013-11-25 11:53:52|113143
sqlite> .quit

C:\temp>sqlite3 test.sqlite3
SQLite version 3.8.1 2013-10-17 12:57:35
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> update test set d=datetime('now');
sqlite> select d, count(*) from test group by d;
2013-11-25 11:56:22|2031098
sqlite>


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to