Unknown column 'SUB_ID' in 'where clause'