问题
I'm trying to create a MySQL query to update PAN no of all members.
Using the query below I keep getting this error and its not something I've come across before, google seems to offer a variety of answers but I'm unable to relate the fix to my query.
UPDATE if_membermaster SET PAN_No = 'ABCD1234D' WHERE 'MemberCode' = 5100
Result:
ERROR:- #1292 - Truncated incorrect DOUBLE value: 'MemberCode'
MemberCode
is int(9) DEFAULT NULL
.
Can any one help to fix this ?
回答1:
You are using wrong quotes (PEBCAK). The where clause is comparing the string 'MemberCode'
with 5100. This forces MySQL to convert both values to double hence the warning. Change single quotes to backticks:
UPDATE if_membermaster SET PAN_No = 'ABCD1234D' WHERE `MemberCode` = 5100
来源:https://stackoverflow.com/questions/52622105/mysql-1292-truncated-incorrect-double-value