更新时间:2023-02-03 15:36:07
如果要在SELECT
语句中使用它,只需使用DATE
运算符:
If you want this in a SELECT
-Statement, just use the DATE
Operator:
SELECT DATE(`yourfield`) FROM `yourtable`;
如果要在结构上更改表,只需将数据类型更改为DATE
(当然,只有在不影响依赖于此字段的应用程序的情况下,才这样做).
If you want to change the table structurally, just change the datatype to DATE
(of course only do this if this doesn't affect applications depending on this field).
ALTER TABLE `yourtable` CHANGE `yourfield` `yourfield` DATE;
两者都会消除时间部分.
Both will eliminate the time part.