clear markdown compare help best fiddles feedback dbanow.uk a leap of faith?
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 1228811 fiddles created (16674 in the last week).

create table people (uniquekey int, passport char(20), id char(20))
 hidden batch(es)


insert into people values (1, 'P12345', 'ID1'), (2, 'PPKL', 'ID2'), (3, 'P54321','ID3'), (4, 'PPKL', 'ID4'), (5, 'PPKL', 'ID1'), (6, 'P11111', 'ID6')
6 rows affected
 hidden batch(es)


select t1.uniquekey, t1.passport ppt, t2.passport dup_ppt from people t1, people t2 where t1.passport = t2.passport AND t1.uniquekey <> t2.uniquekey
uniquekey ppt dup_ppt
2 PPKL PPKL
2 PPKL PPKL
4 PPKL PPKL
4 PPKL PPKL
5 PPKL PPKL
5 PPKL PPKL
 hidden batch(es)