NXP-11521: Add SORTED_COLUMN variable that can be used in a where clause, useful for db optimization, SORTED_COLUMN IS NOT NULL clause enable index usage for sorting
NXBT-11521: fix case when there is a SORTED_COLUMN without an ORDER BY