Unknown column 'tee' in 'where clause'