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' Link to comment https://forums.phpfreaks.com/topic/91779-confusing-multiple-where-statement/ Share on other sites More sharing options...
Barand Posted February 19, 2008 Share Posted February 19, 2008 DON'T double post Link to comment https://forums.phpfreaks.com/topic/91779-confusing-multiple-where-statement/#findComment-470174 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.