delete from c
where exists (select 1 from a,b where c.aid=a.aid and c.bid= b.bid and a.aid=var_a and b.bid = var_b)