Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Intersection

blange13blange13 Member Posts: 2
I have two tables A and B and I want to know what records A has that B doesn't have. What's the best way to go about doing this? I tried Select ID from A where ID not in (select ID from B), but I got an error.

Thanks,

Brian

Comments

  • SouldrinkerSouldrinker Member Posts: 143
    Just try the following MySQL-Statement, it should work fine ;-)

    [code]
    SELECT A.`ID`
    FROM A
    LEFT JOIN B ON B.`ID` = A.`ID
    WHERE B.`ID` IS NULL
    [/code]

    if it doesn't, mail me - I did not test it, but this way it should work - MySQL does not support subselects until version 4 - for that reason your query failed.

    best regards,

    sebastian mohrenstecher
    executive secretary
    net::allies

    www.net-allies.de
    info@net-allies.de

Sign In or Register to comment.