Select Error: Unknown column 'P' in 'where clause'