Unknown column 'investments' in 'where clause'