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.
我有一个这样的数据库:
ID->INT Date->DateTime
现在我想写一个 SELECT 来获取日期列在“2008/1/1”和“2010/1/1”之间的所有行。
SELECT * FROM mytable WHERE `Date` BETWEEN '2008-01-01' and '2010-01-01';
您只需在WHERE子句中应用过滤器
WHERE
select * from yourtable where date >= '2008-01-01' and date <= '2010-01-01'