Unknown column 'p.relevant' in 'where clause'