result of select query with sorting should be array rather than dictionary