Unknown column 'sc.id' in 'where clause'