A class of continuous-time dynamical systems able to sort a list of real numbers is introduced in this paper. The dynamical sorting is achieved in a completely distributed manner, by modifying a consensus problem, namely right multiplying a Laplacian matrix by a diagonal matrix of weights that represents the desired order. The sorting obtained is relative, i.e., a conservation law is imposed on the dynamics. It is shown that sorting can be achieved in finite-time even in a globally smooth way.