Unknown column 'privacy' in 'having clause'