Unknown column 'preliminary' in 'where clause'