Sorting A Database Into Alphabetical Order?

is it possible to sort a database in alphabetical order, say by NAME? i know about the ORDER BY keyword but that only seems to sort data coming out of a database.
[169 byte] By [Alex1989a] at [2007-11-27 6:08:59]
# 1

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.

BalusCa at 2007-7-12 17:12:08 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
so theres no real need to do something like this?
Alex1989a at 2007-7-12 17:12:08 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3
There a database is built for.Oh, I would to re-mention that there is never a 100% guarantee that you will retrieve the results in the same order as they are instered, without using an ORDER BY.
BalusCa at 2007-7-12 17:12:08 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 4
> There a database is built for.sorry i dont understand what ur trying to say here
Alex1989a at 2007-7-12 17:12:08 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 5

> > 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.

cotton.ma at 2007-7-12 17:12:08 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...