select t1.col1, t2.col1 from tab1 t1, tab2 t2 where t1.col1=t2.col1 group by t1.col1, t2.col1 having count(t1.col1) > 1;
select
dv.donor_id,
dv.visit_datetime,
dv.unit_number,
dn.fullname,
dn.address_line1||' '||dn.address_line2||' , '||dn.city||' '||dn.state_cd||' '||dn.zip_cd5 Address,
'(' ||dn.evening_phone_area ||')' ||' '|| dn.evening_phone_prefix ||' '||dn.evening_phone_number EvePhone,
dn.date_of_birth,
Substr (Months_Between (sysdate, dn.date_of_birth)/12,0,2) Age,
Lower (dn.email_address) Email,
dv.donation_type_cd,
dv.historical_blood_type
from
rptdba.donor_visit dv,
rptdba.donor dn
where
dn.donor_id = dv.donor_id and
dv.donation_type_cd Like 'T1' and
dv.historical_blood_type like 'O-' and
dv.batch_date >= to_char(to_date('20120101','YYYYMMDD')) and dv.batch_date <= Sysdate and
dv.visit_status_cd Like 'DN'
Group By
dv.donor_id,
dv.visit_datetime,
dv.unit_number,
dn.fullname,
dn.address_line1,
dn.address_line2,
dn.city,
dn.state_cd,
dn.zip_cd5,
dn.evening_phone_area,
dn.evening_phone_prefix,
dn.evening_phone_number,
dn.date_of_birth,
dn.date_of_birth,
dn.email_address,
dv.donation_type_cd,
dv.historical_blood_type
Having count(dv.donor_id) > 1
Can you post the SQL?
The following example works for me:
Open in new window