結果を得るために、標準の SQL 構文と結合を使用しています
設定:
create table dummy
(
firstname varchar2(20),
lastname varchar2(20),
phone number
);
insert into dummy values('Thor','Prestby',98726364);
insert into dummy values('Thor','Prestby',98726364);
insert into dummy values('Lars','Testrud',12938485);
insert into dummy values('Lise','Robol',12938485);
クエリ:
select a.firstname,a.lastname,a.phone from dummy a inner join dummy b
on a.phone=b.phone and a.firstname != b.firstname and a.lastname != b.lastname;
結果
FIRSTNAME LASTNAME PHONE
-------------------- -------------------- ----------------------
Lise Robol 12938485
Lars Testrud 12938485