I\'m reading through some old code at work, and have noticed that there are several views with an order by 1
clause. What does this accomplish?
Exampl
This:
ORDER BY 1
...is known as an "Ordinal" - the number stands for the column based on the number of columns defined in the SELECT clause. In the query you provided, it means:
ORDER BY A.PAYMENT_DATE
It's not a recommended practice, because:
This will sort your results by the first column returned. In the example it will sort by payment_date.