TecTao Posted February 18, 2008 Share Posted February 18, 2008 I've joined two tables: SELECT * FROM county_Payment_plan cPp LEFT JOIN county_Count Count ON ( cPp.countID = Count.cCt_countID ) LEFT JOIN item_dir ID ON ( Count.cCt_countyID = ID.itd_countyID ) There is a column with State abbreviations, Category Codes and Status Codes. The State abbreviations return all of the state counties. From a previous page, variables are passed state=FL, category code=gp1, status=s I am trying to do a select statement where all Florida counties are returned except those sith "pg1" and "s" so my where clause is WHERE cCt_stateID = 'FL' AND itd_status <> 's' AND `itd_groupPlan` <> 'gp1' Which seem logical, but it returns no results. Ive tried OR as well. I also did the opposite to return all those that were 'GP1' and 'S' SELECT * FROM county_Payment_plan cPp LEFT JOIN county_Count Count ON ( cPp.countID = Count.cCt_countID ) LEFT JOIN item_dir ID ON ( Count.cCt_countyID = ID.itd_countyID ) WHERE cCt_stateID = 'FL' AND itd_status = 's' AND `itd_groupPlan` = 'gp1' Any ideas on the how to get all counties that don't have 'gp1' and 's' Quote Link to comment Share on other sites More sharing options...
aschk Posted February 19, 2008 Share Posted February 19, 2008 Try this (i'm guessing the reason behind your problem is not data related). WHERE cCt_stateID = 'FL' AND itd_status NOT LIKE 's' AND `itd_groupPlan` NOT LIKE 'gp1' Quote Link to comment 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.