If you need to remove based on a list, you can use IN :
delete from your_table where id in (value1, value2, ...);
If you need to delete based on the result of the query, you can also use IN :
delete from your_table where id in (select aColumn from ...);
(Note that a subquery should only return one column)
If you need to delete depending on a range of values, either use BETWEEN or use the inequalities:
delete from your_table where id between bottom_value and top_value;
or
delete from your_table where id >= a_value and id <= another_value;
Barranka Apr 16 '13 at 5:35 2013-04-16 05:35
source share