Suppose I insert a data point into a sqlite3 database on a nightly basis. Could anyone tell me how to obtain the data points for the past 30 days?
Thanks,
Raj
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
SQLite is a very lightweight DB engine, so as far as I know, it doesn’t store historical insert information. You have to have a date field in your table that gets set when you insert data.
One possible hack around this (if you’re in a tight spot) is to use the auto-increment key/id field of your table to get the last 30 rows. This will only work if you haven’t deleted any data since then, and have only been inserting exactly one row per day: