Alastair,

As I think about it, I would say not, we should not expect the order by 
to work this way.  The ORDER BY is sorting the rows in your result 
set. But there is only one row in your result set. Compare what you 
would like with LISTOF here to what you would get with:

SELECT MIN (extension) INTO vResponse FROM FileExtensions 
ORDER BY extension

There is nothing to sort, since there is truly a one-row answer. The 
database engine build a NOTE value as it worked its way through the 
rows that were being summarized, but built only one row.

Also, think what the database engine would do if you asked it to:

SELECT sharename, LISTOF(extension) from fileextensions
group by sharename, order by 2

Bill

On Fri, 20 Dec 2002 07:56:04 -0000, Alastair Burr wrote:

>This got lost in the mists of time in the sonetmail hiccup:
>
>   Does anybody agree with me that this fails:
>
>   SELECT (LISTOF(Extension)) INTO vResponse FROM 
FileExtensions order by
>   Extension
>
>   but these work:
>
>   SELECT (LISTOF(Extension)) INTO vResponse FROM 
FileExtensions
>
>   SELECT (LISTOF(Extension)) INTO vResponse FROM 
FileExtensions where
>   Extension is not null
>
>   SELECT (LISTOF(Extension)) INTO vResponse FROM 
FileExtensions where
>   Extension is not null order by Extension
>
>   (They're all single-line commands.)
>
>   If so, should I expect the first method to work or not?
>
>
>Since then it has been discovered that the third "working" example 
doesn't
>appear to actually sort but doesn't give the error message that the
>non-working example does.
>
>A easy work-around of using a (temp) view to re-order the list has 
also been
>suggested and the need, or otherwise, of two pairs of parenthesis 
has been
>questioned. (R:Syntax shows both!)
>
>See what excitement you've missed while you were away! Welcome 
back.
>Regards,
>Alastair.
>
>----------------------------------
>A D B Burr,
>St. Albans, UK.
>----------------------------------
>[EMAIL PROTECTED]
>----------------------------------
>
>--- RBASE-L
>================================================
>TO POST A MESSAGE TO ALL MEMBERS:
>Send a plain text email to [EMAIL PROTECTED]
>
>(Don't use any of these words as your Subject:
>INTRO, SUBSCRIBE, UNSUBSCRIBE, SEARCH,
>REMOVE, SUSPEND, RESUME, DIGEST, RESEND, HELP)
>================================================
>TO SEE MESSAGE POSTING GUIDELINES:
>Send a plain text email to [EMAIL PROTECTED]
>In the message SUBJECT, put just one word: INTRO
>================================================
>TO UNSUBSCRIBE: 
>Send a plain text email to [EMAIL PROTECTED]
>In the message SUBJECT, put just one word: UNSUBSCRIBE
>================================================
>TO SEARCH ARCHIVES:
>Send a plain text email to [EMAIL PROTECTED]
>In the message SUBJECT, put just one word: SEARCH-n
>(where n is the number of days). In the message body, 
>place any 
>text to search for.
>================================================

Reply via email to