Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Variable for IN clause

I have a need to use a variable in my WHERE IN (@variable) clause because I have multiple and dynamic values being passed into my stored procedure variable. I've seen this done with MS SQL before by creating a function that will split the parameters but I'm not quite sure if that can be implemented on MySQL.

Is there anyway I can get this to work because I really don't have any other options?

Thanks

like image 595
Encryption Avatar asked Sep 06 '25 03:09

Encryption


1 Answers

Maybe a FIND_IN_SET can help you.

like image 132
Mosty Mostacho Avatar answered Sep 09 '25 03:09

Mosty Mostacho