如果b在table1中是主键或者唯一键,那就可以用外键约束,如下:
alter table table2 add constraint fk_table2_table1
 foreign key (c) references table1 (b);如果b既不是主键又非唯一键,那就必须用trigger来处理了
create tigger trg_table2_new on table2
before insert for each row
declare
  w_cnt integer;
begin  select 1
    into w_cnt
    from table1
   where b = :new.c
     and rownum = 1;exception when no_data_found then
   raise_application_error(-20000,'value c does not exist in table1');
end;
/