Solved

Unmatched records in Oracle 10g

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

Turn Insights into Action

Communication across every corner of your business is essential to increase the velocity of your application delivery and support pipeline. Automate, standardize, and contextualize your communication processes with xMatters.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that useā€¦
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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 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.

691 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