Solved

Unmatched records in Oracle 10g

Posted on 2009-07-07
3
544 Views
Last Modified: 2012-05-07
Greeting,
I need tbl1 and tbl2 in oracle 10g. I have field1 and field2 in both table. I need a sql stmt which will give me all the records in tbl1 without matching records in tbl2 base on field1&field2.

thanks in advance
0
Comment
Question by:mrong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 

Accepted Solution

by:
mrong earned 0 total points
ID: 24797182
here it is
SELECT Table1.*
FROM Table1 LEFT JOIN table2 ON
(table1.[fielda] = table2.[fielda]
AND
table1.[fielda] = table2.[fielda]
and etc...
)
WHERE (((table2.[fielda]) Is Null));
0
 
LVL 28

Expert Comment

by:Naveen Kumar
ID: 24801303
try the below :

SELECT a.*
FROM Table1 a
where not exists ( select 1 from table2 b where b.fielda = a.fielda and b.fieldb=a.fieldb );
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 24801719
mrong: your query is already fine, the code of nav_kum_v should work exactly the same.
0

Featured Post

Is Your DevOps Pipeline Leaking?

Is your CI/CD pipeline a hodge-podge of randomly connected tools? You’ve likely got a tool to fix one problem & then a different tool to fix another, resulting in a cluster of tools with overlapping functionality. Learn how to optimize your pipeline with Gartner's recommendations

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need a solid Expert on this Group By Query Syntax Help. 3 55
CRM 2011 Advanced Find Producing Error 3 41
Oracle perfomance tuneing. 3 45
T-SQL: Wrong Result 7 38
I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
PL/SQL can be a very powerful tool for working directly with database tables. Being able to loop will allow you to perform more complex operations, but can be a little tricky to write correctly. This article will provide examples of basic loops alon…
Via a live example, show how to take different types of Oracle backups using RMAN.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question