我在 MySQL 数据库中有一个使用 DATETIME
设置的表.我只需要在此表中 SELECT
仅按 DATE 并排除时间.
I have a table in the MySQL database that is set up with DATETIME
. I need to SELECT
in this table only by DATE and excluding the time.
如何在此表中仅按日期并绕过时间SELECT
,即使该特定列设置为 DATETIME
?
How do I SELECT
in this table by only date and bypassing the time, even if that specific column is set to DATETIME
?
现在是:2012-01-23 09:24:41
我只需要为此做一个 SELECT
:2012-01-23
I need to do a SELECT
only for this: 2012-01-23
SELECT DATE(ColumnName) FROM tablename;
更多关于 MySQL DATE()函数.
这篇关于如何仅从 MySQL 的 DATETIME 字段中选择日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!