在SQLite選擇日期基於月份大於另一月份:
SELECT id, start_date, end_date FROM recur WHERE strftime('%m%Y', start_date) <= '122012' AND strftime('%m%Y', end_date) >= '122012'
I have a row in the database with:
start_date = 2012-12-01
end_date = 2015-05-01
改變日期之後沒有選出更大的月份。有辦法麼?
應該把年放到月之前,這樣才能判斷:
strftime('%Y%m')