Comma separated variable in MySQL

后端 未结 2 602
臣服心动
臣服心动 2021-01-23 07:13

I want to create a stored procedure in MySQL and one of the input parameters will need to be a comma separated list of integers. How do I loop through each integer and run an up

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-23 07:51

    Hmm... well, there is a discussion here in the MySQL reference down at the bottom about taking a string of comma-separated integers and doing a replacement on it to get it into something that you can use "IN" on it.

    I'm assuming your input parameter is a VARCHAR here.

提交回复
热议问题