1, 두 개의 테스트 테이블 작성
create table test _ CJ (name varchar (2), remark varchar2 (2));
create table test _ KC (name varchar (2), remark varchar2 (2));
2, 테스트 데이터 삽입
insert into test _ cjvalues ('xh',' CJ _ 1');
insert into test _ cjvalues ('kcdh',' CJ _ 2');
insert into test _ cjvalues ('CJ',' CJ _ 3');
insert into test _ kcvalues ('kcdh',' KC _ 1');
insert into test _ kcvalues ('kcm',' KC _ 2');
3, 두 테이블을 질의하는 총 레코드 수, select t. *, rowid from test _ CJ t union all select t. *, rowid from test _ KC t, < p B. remark from test _ CJ t, test _ KC b where t.name = B. name 은 kcdh 와 연관된 레코드를 찾을 수 있습니다.