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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query to find unmatched records help

Status
Not open for further replies.

Bronte1226

Technical User
Oct 18, 2002
123
US
I am working on the following query to return results for records that are in the first table and not the second. I am fairly new to this so I am not sure where my mistake is, but I keep getting this syntax error.

"Server: Msg 170, Level 15, State 1, Line 7
Line 7: Incorrect syntax near '.'."

I would greatly appreciate insight...I must have messed up somewhere...

SELECT CUDAddress, CUDName
FROM (
SELECT A.CUDAddress, A.CUDName,
B.OutAddress as BOutAddress
from CUD A
left outer join Outliers
A.CUDAddress = B.OutAddress and
A.CUDName = B.OutName
) FOO
WHERE BOutAddress IS NULL
 
You forgot to alias B
but wouldn't this do the same thing?
Code:
   SELECT A.CUDAddress, A.CUDName
   from CUD A
   left outer join Outliers B
      A.CUDAddress = B.OutAddress and
      A.CUDName = B.OutName
WHERE B.OutAddress IS NULL



"NOTHING is more important in a database than integrity." ESquared
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top