I want to see the same pid(or id from the person_info table) only once with the sql below. Adding "group by pid" in the end would work in MySQL but not in Oracle because I would have to have a group by for each after select. Distinct doesn't work here either because it returns unique combinations and not just pid. This is driving me crazy... Thanks in advance!
select pi.id pid, n.id nid, n.match_mode, n.match_method, n.match_gene_type, n.notification_status, pi.person_name, pi.id_card_no, pi.race from notification n, person_info pi where (n.src_data_id = pi.id or n.match_data_id = pi.id) and n.match_mode = '1' and n.match_gene_type = '1' and n.notification_status = '2' and pi.id_card_no IS NOT NULL