I know how to delete a set of rows with a statements like these:
DELETE FROM my_table WHERE id=23 AND year=2012 AND value=16
DELETE FROM my_table WHERE id=17 AND year=2012 AND value=16
DELETE FROM my_table WHERE id=64 AND year=2012 AND value=16
But I would like to combine the above three statements into a single DELETE where id is either 23, 17, or 64.
What is the syntax for doing this in Oracle SQL?
You can use the SQL
INkeyword. For example:Note: Oracle has a limit of 1,000 items in a list.