【发布时间】:2014-10-08 18:08:15
【问题描述】:
我需要将 mySQL 中的 date 字段视为 string。为了在 LIKE 语句中使用日期:
select * from table where dob like some_string;
目前这样做会产生以下警告:
mysql> show warnings;
+---------+------+--------------------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------------------+
| Warning | 1292 | Incorrect date value: '1492' for column 'dob' at row 1 |
+---------+------+--------------------------------------------------------+
1 row in set (0.00 sec)
【问题讨论】: