Unknown column 'counter' in 'order clause'