?
Solved

Unmatched records in Oracle 10g

Posted on 2009-07-07
3
Medium Priority
?
550 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

770 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