...

View Full Version : Excluding rows from query



Atrhick
10-21-2011, 02:40 PM
I want to get everthing from my table and exclude a few rows... but my query it not working. this is my query and the rows I want to exclude.




$strQuery = "SELECT partner_id_buyer "
. " FROM lead_partners_pages "
. " WHERE partner_id_buyer < 10 OR option = ' ' OR option = '[partner_code]' "
. " GROUP BY partner_id_buyer "
. " ORDER BY partner_id_buyer "
." AND MONTH(date_day)=MONTH(NOW())";



I don't want any rows in the partner_id_buyer column that is blank, has a number less than 10, also want to exclude the rows with [partner_code]. is this possible?

Atrhick
10-21-2011, 04:27 PM
NVM I got it to work



. " WHERE afid_seller_name IS NOT NULL AND afid_seller_name NOT IN ('','0','9','[partner_code]') "



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum