Unknown column 'c' in 'where clause'