问题描述:

//this is my query for single deletion of record.

public void deleteEmpDetails(int emp_Id){

String sql="delete from EmpDetails where emp_Id="+emp_Id;

JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);

jdbcTemplate.update(sql);

}

Will u please tell me wat is query for multiple rows deletion.Please give me the solution.

网友答案:
delete from EmpDetails where emp_Id in (1, 2, ...)
网友答案:

Try this Code,

  public void deleteEmpDetails(int emp_Id){
         String sql="delete from EmpDetails where emp_Id IN "+emp_Id;
         JdbcTemplate jdbcTemplate=new JdbcTemplate(dataSource);
         jdbcTemplate.update(sql);
  } 
相关阅读:
Top