|
- create table t071fi08_pair ( number# number, a varchar2(20), b number );
- insert into t071fi08_pair values (1, 'A' ,1);
- insert into t071fi08_pair values (2, 'A' ,1);
- insert into t071fi08_pair values (3, 'A' ,2);
- insert into t071fi08_pair values (10, 'B' ,2);
- insert into t071fi08_pair values (20, 'B' ,2);
- insert into t071fi08_pair values (30, 'B' ,1);
- commit;
- select * from t071fi08_pair;
- commit;
- select * from t071fi08_pair;
- select *
- from t071fi08_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 ( select a from t071fi08_pair where number#
- in ( 1,10))
- and
- b in ( select b from t071fi08_pair where number#
- in ( 1,10))
- and number# not in (1,10);
复制代码- UPDATE
- SET
- employees
- (job_id,salary) = (SELECT job_id,salary
- FROM
- employees
- WHERE
- employee_id = 205)
- WHERE
- employee_id
- = 103;
复制代码
|
|