为什么sql查询
UPDATE `singleent` SET `pre_timestamp` = CURRENT_TIMESTAMP WHERE listingType = 1
给出错误,而
UPDATE `singleent` SET `pre_timestamp` = CURRENT_TIMESTAMP WHERE 1
或
UPDATE `singleent` SET `pre_timestamp` = CURRENT_TIMESTAMP
完美运行?
修改:
列类型为时间戳,错误为:
截断不正确的静态值:选择listingType
答案 0 :(得分:0)
错误是由于listingType属于Type varchar所以它需要将值放在单个引号中''
查询
UPDATE `singleent`
SET `pre_timestamp` = CURRENT_TIMESTAMP
WHERE listingType = '1'
很完美