Fix query DUPSORT.