Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Query to get Unmatched records from a table

Rick LayAug 24 2023 — edited Aug 24 2023

Hi Expert, I need your help….I want to make a salesforce comparison to choose the duplicate in igen. If a salesforce record matches an igen record, disregard the matching records. I simply need the records that are unmatched for this issue.

Eg these are the records in the table I want the unmatched ones and examples of sample data below. I am using oracle 9i.

Thanks

SOURCE,ACCOUNT_NO,PRODUCT
IGEN,72161738,IPHONE 14          <<< unmatched
IGEN,72161738,IPHONE 13         <<< disregard
SALESFORCE,72161738,IPHONE 13       <<< disregard
IGEN,69859029,IPHONE 14         <<< unmatched
IGEN,69859029,IPHONE 14         <<<  disregard
SALESFORCE,69859029,IPHONE 14         <<< disregard
  CREATE TABLE ORACLE_TABLE 
  (    SOURCE VARCHAR2(20), 
    ACCOUNT_NO VARCHAR2(20), 
    PRODUCT VARCHAR2(50)
  )

Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('IGEN','72161738','IPHONE 14');
Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('IGEN','72161738','IPHONE 13');
Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('SALESFORCE','72161738','IPHONE 13');
Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('IGEN','69859029','IPHONE 14');
Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('IGEN','69859029','IPHONE 14');
Insert into ORACLE_TABLE (SOURCE,ACCOUNT_NO,PRODUCT) values ('SALESFORCE','69859029','IPHONE 14');
This post has been answered by Barbara Boehmer on Aug 24 2023
Jump to Answer
Comments
Post Details
Added on Aug 24 2023
16 comments
1,045 views