Unknown column 'tipo' in 'order clause'