在Oracle数据库中,使用DELETE语句删除数据时,需要指定一个WHERE子句来指定删除的条件。WHERE子句中的条件可以根据需要进行复杂的逻辑运算和比较操作,以确保只删除符合条件的数据。
以下是一些常见的DELETE条件选择示例:
DELETE FROM employees WHERE age > 30;
DELETE FROM employees WHERE salary < 5000;
DELETE FROM employees WHERE department_id = 10;
DELETE FROM employees WHERE name = '张三';
DELETE FROM employees WHERE name LIKE '张%';
DELETE FROM employees WHERE salary > 5000 AND department_id = 20;
DELETE FROM employees WHERE name = '李四' OR department_id = 30;
请注意,在使用DELETE语句时,务必确保WHERE子句中的条件是正确的,以避免意外删除重要数据。建议在删除数据之前先执行SELECT语句来验证要删除的数据是否符合预期。