Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在我的 OrientDB 实例中,条目具有date存储为java.util.Date.
date
java.util.Date
我想获得在给定年份写的所有文件。但我不认为写作
SELECT FROM posts WHERE date.format('yyyy')=2012
是最好的办法。或者是吗?
给定的查询非常低效,将执行全表扫描。最好是使用(可以使用可能的索引):
select from posts where date between '2012-01-01 00:00:00' and '2012-12-31 23:59:59'
假设:日期的类型为 Date(Time)