datetime mySQL SELECT只有日期 [英] datetime mySQL SELECT only date
本文介绍了datetime mySQL SELECT只有日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要 SELECT
在这个表格中,只有在DATE,并排除时间。
如何在此表中的 SELECT
绕过时间,即使该特定列设置为 datetime
?
示例:
现在是: 2012-01-23 09:24:41
我只需要一个 SELECT
只为这个 2012-01-23
解决方案
从tablename选择日期(ColumnName)
更多关于 mysql date()
I have a table in the mySQL DB that is set up with datetime.
I need to SELECT
in this table only by DATE and excluding the time.
How do I SELECT
in this table by only date and bypassing the time, even if that specific column is set to datetime
?
Example:
Now it is: 2012-01-23 09:24:41
I need to do a SELECT
only for this 2012-01-23
解决方案
select date(ColumnName) from tablename
more on mysql date()
这篇关于datetime mySQL SELECT只有日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文