jeff5656 Posted December 10, 2010 Share Posted December 10, 2010 I want to run a query on table 1 but exclude records if the field v3 matches the field "mrn" in table 2: I was told to use LEFT OUTER JOIN but this doens't work: Code: SELECT * FROM pts LEFT OUTER JOIN p_list ON pts.v3 = p_list.mrn WHERE pts.v3 IS NULL When I do that nothing is displayed. I don't know if the "IS NULL" term is the problem. Can someone help me with what the php code is to make that query work? Link to comment https://forums.phpfreaks.com/topic/221240-trying-to-exclude-something-from-table/ Share on other sites More sharing options...
OOP Posted December 10, 2010 Share Posted December 10, 2010 What are the keys in both tables? it would be good if you can post the tables structures Link to comment https://forums.phpfreaks.com/topic/221240-trying-to-exclude-something-from-table/#findComment-1145483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.