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.
型号:Foo
字段:id(长)、barDate(日期)、barDay(整数 1..7)
数据库:Mysql
当 barDate 是今天(不关心小时、分钟、秒)或 barDay 是今天的星期几时,如何查询 Foo?
你能给我举个 HQL 或 SQL 的例子吗?谢谢。
尝试这个:
from Foo where date_format(barDate ,'%Y%m%d') = CURDATE()