要求传递过来的字符串格式为:xxxx,xxx,xxxxx,xxxx,(两边可以有逗号).
string.Format("delete table1 where id in ('{0}')", ids.Trim(',').Replace(",", "','"));
本文介绍了一种使用SQL语句批量删除记录的方法。通过格式化字符串,可以实现根据指定ID列表进行数据表记录的批量删除操作,提高了数据管理的效率。
要求传递过来的字符串格式为:xxxx,xxx,xxxxx,xxxx,(两边可以有逗号).
string.Format("delete table1 where id in ('{0}')", ids.Trim(',').Replace(",", "','"));

被折叠的 条评论
为什么被折叠?