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.
我有一个 sql select 语句,它返回“last_edited”变量(时间戳)在本周内的所有行:
SELECT vote FROM votes WHERE WEEK(vote_time)=WEEK(now())
这很好用,但我希望一周从星期一而不是星期日开始,所以我尝试了这个:
SELECT vote FROM votes WHERE WEEK(vote_time, 1)=WEEK(now(), 1)
但这没有返回任何结果。知道为什么吗?
尝试:
WEEK(timestamp, 1)
查看文档。