-1

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 ?

  • data type of ```id``` is ```int```. I got ```'12,13'``` from ```GROUP_CONCAT()``` which automatically creates a string having commas but as this is a string it gives error inside ```IN()``` – Sagar Sangwan Sep 16 '22 at 04:53
  • 1
    https://stackoverflow.com/a/11957706/575376 – juergen d Sep 16 '22 at 05:12
  • Either FIND_IN_SET or dynamic SQL. – Akina Sep 16 '22 at 06:39
  • Does this answer your question? [MySQL variable format for a "NOT IN" list of values](https://stackoverflow.com/questions/11957643/mysql-variable-format-for-a-not-in-list-of-values) – Rohit Gupta Sep 17 '22 at 23:59

1 Answers1

0

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);