I have a table which has only 3 columns. When I type the following query
select * from MyTable order by 5 and 2;
select * from MyTable;
What is happenning here is that
5 and 2 is seen as an expression which is evaluated to 1. However, it shouldn't give a result sorted by first column.
Actually, I think you only get sorted data because you inserted it in sorted sequence. Take a look at this SQLFiddle:
The data is not sorted by
any of the columns, it is being sorted by a