select cat from directory where is_archived=0 and site_url != '' and (city='beaver dam' OR city='beaver_dam') and (state='KY' OR state='Kentucky')
select cat from directory where is_archived=0 and site_url != '' and (city='beaver dam' OR city='beaver_dam') and (state='KY' OR state='Kentucky')
union
select cat from affiliate_directory where is_archived=0 and site_url != '' and (FIND_IN_SET('beaver_dam', city) OR city='all' ) and (state='KY' OR state='Kentucky' OR state='all')