mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答
来源:懂视网
责编:小采
时间:2020-11-09 16:43:20
mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答
mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答:mysql mysql> desc card_info;+-------------+-----------+------+-----+-------------------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+-----------+------+-----+-------------------+-------+| card_number | char(20) |
导读mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答:mysql mysql> desc card_info;+-------------+-----------+------+-----+-------------------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+-----------+------+-----+-------------------+-------+| card_number | char(20) |
mysql
mysql> desc card_info;
+-------------+-----------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-----------+------+-----+-------------------+-------+
| card_number | char(20) | NO | PRI | | |
| hit_time | int(11) | NO | | 0 | |
| modify_time | timestamp | NO | | CURRENT_TIMESTAMP | |
+-------------+-----------+------+-----+-------------------+-------+
card_number做insert条件时,值需要加单引号;
做update条件时,一个长度为15的值不加单引号才能实现,一个长度为19的值无论加不加单引号都无法实现更新
声明:本网页内容旨在传播知识,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。TEL:177 7030 7066 E-MAIL:11247931@qq.com
mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答
mysqlchar类型主键做查询、更新条件时遇见怪事了,求大神解答:mysql mysql> desc card_info;+-------------+-----------+------+-----+-------------------+-------+| Field | Type | Null | Key | Default | Extra |+-------------+-----------+------+-----+-------------------+-------+| card_number | char(20) |