I am a having a table with column Symbol and Weight(only two Column) . I need to sort table according to weight of the symbols, that i can do by
SELECT symbol, weight FROM symbols ORDER BY weight DESC
but this wont change my table, but it will give me a sorted output(temporary).
I want to sort table permanently. How can i do that?
You can do this with ALTER TABLE
f.e.
ALTER TABLE tablename ORDER BY columnname ASC;.
but be aware that the table does not remain in this order after inserts and deletes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With