如何从具有多个组合的两个过滤子句的表中删除

时间:2015-03-04 13:51:04

标签: sql oracle dynamic oracle11g

delete from connect_customer_trans_bkp
where (order_number,client_id) in (('0000220','ASD'),
                                   ('0000221','acf'),
                                   ('0000222','ddd'));

而不是写作:

delete from connect_customer_trans_bkp
where (order_number='0000220'and client_id='ASD') or 
      (order_number='0000221'and client_id='acf') or
      (order_number='0000222'and client_id='ddd');

1 个答案:

答案 0 :(得分:0)

怀疑连接会起作用,OR选项的问题是什么?

delete from connect_customer_trans_bkp
     where order_number||client_id in ('0000220ASD','0000221acf','0000222ddd');