110,533
社区成员
发帖
与我相关
我的任务
分享
ArrayList ids = new ArrayList();
ids.Add("1"); // 注意,原代码中存的是字符串1,而不是数字1
ids.Add("2");
...
string sql = string.Format("update td set count = count +1 where id in {0}",ids);
var ids = (new[] { "1", "2", "3" }).Aggregate((a, b) => a + "," + b);
string sql = string.Format("update td set count = count +1 where id in ({0})", ids);
update td set count = count +1 where id in ('1','2');...