Many DBs have a concept of a temporary table, even assuming you don't have a temporary table you can always generate one with a unique name and drop it when you are done. While the overhead of creating and dropping a table is large, this may be reasonable for very large operations, or in cases where you are using the database as a local file or in memory (SQLite).
An example from something I am in the middle of (using Java/SqlLite):
String tmptable = "tmp" + UUID.randomUUID();
sql = "create table " + tmptable + "(pagelist text not null)";
cnn.createStatement().execute(sql);
cnn.setAutoCommit(false);
stmt = cnn.prepareStatement("insert into "+tmptable+" values(?);");
for(Object o : rmList){
Path path = (Path)o;
stmt.setString(1, path.toString());
stmt.execute();
}
cnn.commit();
cnn.setAutoCommit(true);
stmt = cnn.prepareStatement(sql);
stmt.execute("delete from filelist where path + page in (select * from "+tmptable+");");
stmt.execute("drop table "+tmptable+");");
Note that the fields used by my table are created dynamically.
This would be even more efficient if you are able to reuse the table.