Unknown column 'distribution' in 'where clause'