Subject Re: Valid reasons for sorting on a column one doesn't select?
Author Svein Erling Tysvær
Hi Paul!

> Can anyone give me a few valid reasons why
> one might want to sort on a field that
> one doesn't select?

Well, obviously you want the order, but don't care about the value.
Anyone can imagine such situations. Selecting the value will of course
add to the volume of data that needs to be transferred as well, and if
you're on a slow internet connection and is interested in an integer
value, but sorted on long (var)char values (I almost forgot that an
order by may involve several fields), I guess it could be significant
(imagine wanting only the phone number, but sorted on country, town,
address, name and date of birth).

Though I've never been in such a situation myself, and think of it as
rather a theoretical than a practical problem. Is Firebird or Oracle
correct? Well, I'm more interested in knowing what the SQL standards
says. If it is silent about the subject, then it is a matter of taste.

Until I learn more about this subject, I consider Firebirds' behaviour
a nice obscurity. And I think of having to select the fields in the
order by as Oracle demands, as a possibly irritating, but
insignificant fact.