nabeel21 Posted October 20, 2003 Share Posted October 20, 2003 Here are 2 tables which share the same columns (CITY and COUNTY) TB1 (Main table that stores the info of all cities and counties) CITY-------------------------COUNTY --------------------------------------- Tampa----------------------Hillsborough Orlando---------------------Orange Frostproof-------------------Polk Arcadia----------------------Desoto County----------------------Collier Tallahassee-----------------Leon ---------------------------------------------- TB2 (Contains info for all cities and counties who have submitted data) CITY--------------------------COUNTY --------------------------------------- Arcadia----------------------Desoto County----------------------Collier Tallahassee-----------------Leon ------------------------------------------------ Now I want to query TB1 and find out which city/county has NOT submitted their data. The query should return CITY-------------------------COUNTY ---------------------------------------- Tampa----------------------Hillsborough Orlando---------------------Orange Frostproof------------------Polk Thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/1193-join-two-tables-and-return-missing-rows/ Share on other sites More sharing options...
Barand Posted October 20, 2003 Share Posted October 20, 2003 SELECT TB1.city FROM TB1 LEFT JOIN TB2 ON TB1.city = TB2.city WHERE TB2.city IS NULL hth Quote Link to comment https://forums.phpfreaks.com/topic/1193-join-two-tables-and-return-missing-rows/#findComment-3995 Share on other sites More sharing options...
nabeel21 Posted October 24, 2003 Author Share Posted October 24, 2003 Barand: Thanks alot man... it works perfectly. -- thankssss Quote Link to comment https://forums.phpfreaks.com/topic/1193-join-two-tables-and-return-missing-rows/#findComment-4073 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.