0

I'm new in mysql. I have declared a variable in a store procedure like this:

DECLARE ids VARCHAR(255);
SET ids = '51,254,22';

How can I pass this to where ... in clause like this?

SELECT * FROM images WHERE id IN (ids);

by writing the above code only first row is in the output. How can I get the correct answer including all rows that have been found?

Thanks in advance.

mohammad
  • 505
  • 4
  • 17

0 Answers0