--数组

var arrs= ['test1','test2','test3'];
--变字符串

var instring = "'"+arrs.join("','")+"'";
--拼接

var sql = "select * from table where CreateUser in ("+instring+")";
--结果

select * from table where CreateUser in ('test1','test2','test3')

 

posted on 2019-10-14 17:13  小陆老师  阅读(2161)  评论(0编辑  收藏  举报