Solved

Unmatched records in Oracle 10g

Posted on 2009-07-07
3
537 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
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 142

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now