Jay Sprenkle wrote:


is there is any way so that i can store the result
of a select query and execute a delete query on the
same table with out using any other buffer?

How about:

select id
into temp_table
from source_table
where somecondition = true;

delete from source_table
where id in ( select id from temp_table );

Jay,

I don't believe there is an option to "select into" in SQLite. So your first statement should probably be a "create as". Also, you should delete the temp table after the delete. Your solution should read like this:

create temp temp_table as
   select id from source_table where some_condition = true;
delete from source_table
   where id in (select id from temp_table);
drop temp_table;

But I have to wonder why you suggest creating the temp table at all when this does the same thing:

delete from source_table
   where id in
       (select id from source_table where some_condition = true);

Dennis Cote

Reply via email to