Selecting all records entered in a particular day - MySQL

前端 未结 2 631
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-15 19:06

I am currently working on a Mailbox for a website, holding a large number of messages within a database, where there is an option to filter the mails according to th

2条回答
  •  梦谈多话
    2021-01-15 19:33

    I suggest first that you maintain the records in the table sorted by date. Doing so, allows you to not need to compare every value, but you can use binary search to find the two boundaries (begin and end) of records with the desired date. I would also use the time stamp. If you store is as timesstamp and not as text, it will be number, and its very fast at doing the comparison.

提交回复
热议问题