Relational databases don't work that way. An index is a means to select values doing less work (this is, not having to scan all rows to find a value), it's not a means to order the values in a result set.
In fact, most (all?) relational databases guarantee only one thing related to order, and that is that there is no guaranteed order if no order by clause is present in the query.
So, if you want ordered results you have to use the order by clause, like
select * from orders order by order_num
By default, order by column
will order in ascending order. If you want it the other way around you can use order by column desc
. order by column asc
also exists.
To order by multiple columns you specify them separated by comma
select * from orders order by order_num asc, name desc