首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

拼sql话语 批量删除

2012-07-25 
拼sql语句批量删除String sqldelete from table where id in(0String id[]要删除的ID数组for(int i

拼sql语句 批量删除


String sql="delete from table where id in(0";
String id[]=要删除的ID数组;
for(int i=0;i<id.length;i++)
{
?? sql+=","+id[i];
}
sql+=")";
PreparedStatement ps=conn.prepareStatement(sql);
ps.execute();

热点排行