Fix for NULL sorting order in Oracle and PostgreSQL