The problem
The Open SGID sorts NULL values in the opposite direction than the SGID and esri file geodatabases.
The reason
A PostgreSQL order by ascending query will order NULL values last, while the SGID (Microsoft SQL Server) and file geodatabases order them first.
The workaround
Invert the sort to have NULL values ordered they way you would like.
Examples
The PostgreSQL language supports the NULL value ordering in the ORDER BY clause. documentation
The following will crash ArcGIS Pro version < 2.5 if used as a query layer query.
SELECT * FROM municipal_boundaries ORDER BY minname NULLS FIRST;
The problem
The Open SGID sorts
NULLvalues in the opposite direction than the SGID and esri file geodatabases.The reason
A PostgreSQL order by ascending query will order
NULLvalues last, while the SGID (Microsoft SQL Server) and file geodatabases order them first.The workaround
Invert the sort to have
NULLvalues ordered they way you would like.Examples
The PostgreSQL language supports the
NULLvalue ordering in theORDER BYclause. documentationThe following will crash ArcGIS Pro version < 2.5 if used as a query layer query.