Add distinct on clause