成对比较(限定更强)和不成对比较:
create table t071fi08_pair ( number# number, a varchar2(20), b number );insert intot071fi08_pair values (1, 'A' ,1);
insert intot071fi08_pairvalues (2, 'A' ,1);
insert into t071fi08_pairvalues (3, 'A' ,2);
insert intot071fi08_pair values (10, 'B' ,2);
insert intot071fi08_pairvalues (20, 'B' ,2);
insert into t071fi08_pairvalues (30, 'B' ,1);
commit;
select * from t071fi08_pair;
commit;
select* fromt071fi08_pair;
select *
fromt071fi08_pair
where (a,b)in (select a,b from t071fi08_pair where number#
in ( 1,10))
and number# not in (1,10);
select *
from t071fi08_pair
where a in ( selecta from t071fi08_pair wherenumber#
in ( 1,10))
and
b in( selectb fromt071fi08_pair where number#
in ( 1,10))
andnumber# not in (1,10);
UPDATE
SET
employees
(job_id,salary) = (SELECT job_id,salary
FROM
employees
WHERE
employee_id = 205)
WHERE
employee_id
= 103;
页:
[1]