Skip to content
Advertisement

getting warning of 1292 Truncated incorrect DOUBLE value using IN operator in mysql

I’m trying to get the total of a column which is dependent on the invoice table. I have successfully written the whole query but the problem is that if I write static values, it gives the perfect result but if I write column name, it gives the wrong result with a warning (Warning: #1292 Truncated incorrect DOUBLE value…).

Query That results in the warning is

Query That results perfectly is

Where is the mistake? I have already wasted my 2 hours to figure out this.

Advertisement

Answer

I suspect that sale_invoice.items is a string containing comma separated integer values.
If this is the case then IN does not work.
Use the function FIND_IN_SET():

If sale_invoice.items contains spaces between the items, you must remove them:

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement