0

I know this might be a very simple one, but yet I can't figure that one out!
How do I get data from one table that are not in another?

Let's say Table ServerA has: IP, User, Password, Table ServerB has: IP, CanConnect.
If ServerA has 20 rows and ServerB has 13 rows. How do I get those 7 rows that are in ServerA but not in ServerB?

Here's what I got, but it's not giving me what I want:

SELECT ServerA.*
FROM ServerA WHERE NOT EXISTS (
SELECT * FROM ServerB
WHERE ServerA.IP = ServerB.IP)
SELECT ServerA.*
FROM ServerA LEFT JOIN ServerB ON ServerB.IP = ServerA.IP
WHERE ServerB.IP IS NULL

Any help would be much appreciated!

2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by ruba_cti
1

Both of these worked fine when I tested them. The only thing I can think of is that there is some sort of datatype mismatch, or appended spaces, non-printable characters (think "TAB" or "CRLF").

What does your data look like?

0

That was it BitBlt! non-printable characters....I imported the data originally from a text file into a table. By just looking at it, you'd think it matched...
That one caused me grief :)
Thanks!!!!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.