GEOT-4430: App schema joining with duplicate ORDER BY causes SQL Server exception