关于mysql like 查询用 = 出现的深层次问题

我什么使用等于 还能把数据查出来?

在这里插入图片描述

  • receivetime 类型是 datetime

Be aware of certain properties of date value interpretation in MySQL:

  • MySQL permits a “relaxed” format for values specified as strings, in which any punctuation character may be used as the delimiter between date parts or time parts. In some cases, this syntax can be deceiving. For example, a value such as '10:11:12' might look like a time value because of the :, but is interpreted as the year '2010-11-12' if used in date context. The value '10:45:15' is converted to '0000-00-00' because '45' is not a valid month.

    The only delimiter recognized between a date and time part and a fractional seconds part is the decimal point.

  • The server requires that month and day values be valid, and not merely in the range 1 to 12 and 1 to 31, respectively. With strict mode disabled, invalid dates such as '2004-04-31' are converted to '0000-00-00' and a warning is generated. With strict mode enabled, invalid dates generate an error. To permit such dates, enable ALLOW_INVALID_DATES. See Section 5.1.10, “Server SQL Modes”, for more information.

  • MySQL does not accept TIMESTAMP values that include a zero in the day or month column or values that are not a valid date. The sole exception to this rule is the special “zero” value '0000-00-00 00:00:00', if the SQL mode permits this value. The precise behavior depends on which if any of strict SQL mode and the NO_ZERO_DATE SQL mode are enabled; see Section 5.1.10, “Server SQL Modes”.

  • Dates containing 2-digit year values are ambiguous because the century is unknown. MySQL interprets 2-digit year values using these rules:

    • Year values in the range 00-69 become 2000-2069.
    • Year values in the range 70-99 become 1970-1999.

翻译:

请注意 MySQL 中日期值解释的某些属性:
MySQL 允许将值指定为字符串的“宽松”格式,其中任何标点符号都可以用作日期部分或时间部分之间的分隔符。在某些情况下,这种语法可能具有欺骗性。例如,由于 , 的值’10:11:12’可能看起来像时间值,但如果在日期上下文中使用:,则被解释为年份。'2010-11-12’该值 '10:45:15’转换为 '0000-00-00’因为 '45’不是有效月份。

日期和时间部分与小数秒部分之间唯一可识别的分隔符是小数点。

服务器要求月份和日期值有效,而不仅仅是分别在 1 到 12 和 1 到 31 的范围内。'2004-04-31’在禁用严格模式的情况下,将转换为 无效日期 '0000-00-00’并生成警告。启用严格模式后,无效日期会产生错误。要允许此类日期,请启用 ALLOW_INVALID_DATES. 有关详细信息,请参阅 第 5.1.10 节,“服务器 SQL 模式”。

?MySQL 不接受TIMESTAMP在日或月列中包含零的值或不是有效日期的值。如果 SQL 模式允许此值,则此规则的唯一例外是特殊的“零”值 。'0000-00-00 00:00:00’确切的行为取决于是否 NO_ZERO_DATE启用了严格 SQL 模式和 SQL 模式中的哪一个;请参阅第 5.1.10 节,“服务器 SQL 模式”。

包含 2 位数年份值的日期不明确,因为世纪未知。MySQL 使用以下规则解释 2 位数年份值:

  • 范围内的年份值00-69变为 2000-2069。
  • 范围内的年份值70-99变为 1970-1999。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值