Unknown column 'distributor' in 'where clause'