How to store and get datetime value in SQLite

前端 未结 3 1543
感情败类
感情败类 2020-12-28 21:27

My table contains Birthdate field which has datatype as datetime. I want to get all records having birthday today. How can I get it?

3条回答
  •  悲哀的现实
    2020-12-28 22:06

    Try this query:

    SELECT * FROM mytable
    WHERE strftime('%m-%d', 'now') = strftime('%m-%d', birthday)
    

提交回复
热议问题