Error Code 1292 - Truncated incorrect DOUBLE value - Mysql

Error Code 1292 – Truncated incorrect DOUBLE value – Mysql

Error Code 1292 – Truncated incorrect DOUBLE value – Mysql

This message means youre trying to compare a number and a string in a WHERE or ON clause. In your query, the only potential place where that could be occurring is ON ac.company_code = ta.company_code; either make sure they have similar declarations, or use an explicit CAST to convert the number to a string.

If you turn off strict mode, the error should turn into a warning.

I corrected this error as there was a syntax error or some unwanted characters in the query, but MySQL was not able to catch it. I was using and in between multiple fields during update, e.g.

update user 
set token=lamblala, 
    accessverion=dummy and 
    key=somekey 
where user = myself

The problem in above query can be resolved by replacing and with comma(,)

Error Code 1292 – Truncated incorrect DOUBLE value – Mysql

I was facing the same issue. Trying to compare a varchar(100) column with numeric 1. Resulted in the 1292 error. Fixed by adding single quotes around 1 (1).

Thanks for the explanation above

Related posts on My sql :

 

Leave a Reply

Your email address will not be published.