Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to attain a portion of a query

Status
Not open for further replies.

metzy

Programmer
Jan 23, 2004
1
US
Hello everyone, i'm new to the forum.

My problem is. i have to update a live table, ORG, it contains information on corporate authors. i have a batch file that is being processed by perl. it had a few issues. but i have cleansed the data enough so that it looks correct.

SELECT
*
FROM
xcauthors2 x

INNER JOIN org o ON o.an = x.an and .otype = 'c' AND o.org = x.org and o.str = x.str

ORDER BY X.AN
total records retrieved = 33965
this query should return the number of records that are matched by an, org, and str, by the way there is no unique identifier, a unique entry is identified by the an, org, str, combination.


the total number of records retrieve from the batch file is 39107.

so i'm now at the point where i want to take a look at the 79 records that do not match.


SELECT *
FROM xcauthors2 x
WHERE not exists
(select * from org where org = x.org and an = x.an and str = x.str and otype='c')


total records returned = 5140

33965
+5140
---------

39105

my question is what happened to the 2 extra records. and why is the query not exact.

any comments would help.

thank you
Metzy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top