MySQL 存储过程传参数实现where id in(1,2,3,...)示例
2017-02-06
27
正常写法: 复制代码 代码如下: select * from table_name t where t.field1 in (1,2,3,4,...); 当在写存储过程in里面的列表用个传入参数代入的时候,就需要用到如下方式: 主要用到find_in_set函数 复制代码 代码如下: select * from table_name t where find_in_set(t.field1,"1,2,3,4"); 当然还可以比较笨实的方法,就是组装字符...