Unknown column 'x.a' in 'where clause'