SQL> create table t1(a int,b int,c int);
表已创建。
SQL> alter table t1 add constraint t1_pk primary key(a,b);
表已更改。
SQL> create table t2(a int,b int,c int);
表已创建。
SQL> alter table t1 add constraint t2_f foreign key(a,b) references t1(a,b);
表已更改。
SQL> insert into t1 values(1,2,3);
已创建 1 行。
SQL> insert into t2 values(1,2,4);
已创建 1 行。
SQL> commit;
提交完成。
SQL> update t1 set c=4 where a=1 and b=2;
已更新 1 行。
SQL> commit;
提交完成。
你的yjxh=3 and ejxh=1; 是不是不在同一行
|