Unknown column 'ret' in 'where clause'