On May 18, 2011, at 10:50 PM, Danilo Cicerone wrote:

> How can I simulate a
> calendar table(maybe using the strftime funtion)?

Well, you have two broad options:

(1) materialize the calendar as a table 
(2) virtualize the calendar as a generator

The first option is brutal, but simple. E.g. create a table with, say, all the 
julian date from 20000101 to 21001231 (2451544 to 2488433 JD, about 36,889 
records for a century worth of date) 

The second option is a bit more involved, but you could have a virtual calendar 
table that generate the relevant date span on demand:

http://www.sqlite.org/vtab.html

Unfortunately, there is no direct way to generate rows in SQLite as there is, 
for example, in Oracle or such:

http://www.orafaq.com/wiki/Oracle_Row_Generator_Techniques

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

Reply via email to