Simple sqlite3 syntax question
Im new to sqlite3 (and databases in general for that matter). Anyway, in my database i have a date column and i wanted to get all of the data within the 3 days of the current date.开发者_如何学Python Here is the query I have. I am just not sure if there is a built in way to get nearby dates in sqlite3. I dont know what to put in the '?'s.
SELECT date FROM fooTable WHERE date('now') ???????
Try this (3 days is 3*86400 seconds):
SELECT date FROM fooTable WHERE strftime('%s', now) - strftime('%s',date) < 259200
精彩评论