1) SELECT * FROM table ORDER BY name
2) Store the values in memory.
3) TRUNCATE table
4) INSERT the stored values back in table in the same order as they are retrieved.
But why do you want to do this anyway? In a well-indexed database a simple ORDER BY query isn't a pain.
> > There a database is built for.
>
> sorry i dont understand what ur trying to say here
What he was saying is that "this is what a database is for". Databases are for storing data efficiently (which certainly does not mean in alphabetical order) for quick access. And they have an API for getting the data (SQL) and you can always use ORDER BY to sort the results as you would like.
In other words. A database is not a spreadsheet, and you should not be worrying about how the data is stored in the database. ORDER BY is not just for convienence, it has an actual purpose.