Unknown column 'sensor' in 'where clause'