fixed order_by in table and sql view CDB-2784
Merge CDB-2784 into release/2.13.3