How to resolve the error 1292 on using a comma separated string inside IN() in mysql?

Viewed 25

I am using the query

select * from wallet_transaction where id IN('12,13');

I got '12,13' from GROUP_CONCAT()

it gives this error

Truncated incorrect DOUBLE value: '12,13'

One solution i got is switching off the strict mode but i don't want to do this

what's the solution ?

1 Answers

When we use GROUP_CONCAT(), this will automatically become a string that's why you are facing the issue. IN value is considering the Integer. Please write as below query.

select * from wallet_transaction where id IN(12,13);
Related