Sort data query using the first order