MYSQL选择日期早于datetime的行 [英] MYSQL Select rows where date is older than datetime
本文介绍了MYSQL选择日期早于datetime的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在为一个网站编写一个状态项,需要加载比包含datetime的变量更早的状态。
I am coding a status item for a website and need to load statuses older than a variable that contains a datetime.
所以数据库有一个称为添加日期的字段这是一个datetime字段,我有一个datetime格式的字符串,我想选择比我的datetime格式字符串更旧的行。
So the database has a field called added date which is a datetime field and I have a string in datetime format and i want to select all rows older than my datetime format string.
如何在MYSQL中进行组织?
How would this be structured in MYSQL?
提前感谢
推荐答案
select status_column from your_table
where added_date < '2012-05-12'
这篇关于MYSQL选择日期早于datetime的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文