[ic] sql-query sort

Marty Tennison interchange-users@interchange.redhat.com
Mon Dec 31 18:09:01 2001


>
>  >> How do you define sort for sql-query?
>
>  >Use 'ORDER BY' in your sql query.
>
> What if I want to display the sql query in the same order as the
> database is
> (In which the Key Field is sorted in order of importance to me,
> but not in any algorithmic way)

One way (out of many) to do it...

1. Add a new column to the table
2. Add integers to that column that correspond to importance
3. Sort on that column.

If you have already sorted your database so that a full table scan would
produce the desired results then you could probably sort on ROWID or
something similar.  If the table is indexed you will need to take that into
consideration also.