aeroswat Posted March 10, 2010 Share Posted March 10, 2010 Is there a SQL statement I could write that would show me all of my results that weren't linked to another table? For instance I have 2 tables that can be joined on the SchoolSystem field tblSchools (2 fields): - SchoolSystem - Account tblOrders (2 fields): - SchoolSystem - Title I want to display only the orders that have schoolsystems that cannot be found in the tblSchools database. Link to comment https://forums.phpfreaks.com/topic/194783-sql-statement-question/ Share on other sites More sharing options...
aeroswat Posted March 10, 2010 Author Share Posted March 10, 2010 This is what i've tried so far but its saying the query is wrong SELECT o.*, s.* FROM tblOrders as o OUTER JOIN tblSchools AS s ON o.SchoolSystem = s.SchoolSystem WHERE s.SchoolSystem IS NULL Link to comment https://forums.phpfreaks.com/topic/194783-sql-statement-question/#findComment-1024258 Share on other sites More sharing options...
aeroswat Posted March 10, 2010 Author Share Posted March 10, 2010 Figured it out... It should have been a LEFT JOIN... I thought that OUTER JOIN is by default a LEFT JOIN or (LEFT OUTER JOIN) tho Link to comment https://forums.phpfreaks.com/topic/194783-sql-statement-question/#findComment-1024271 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.