order by clause

From: Allison Rothmel <ad041_at_Freenet.carleton.ca>
Date: Fri, 24 Sep 1993 00:30:41 GMT
Message-ID: <CDu1F6.33y_at_freenet.carleton.ca>


I believe this should be a simple command.

I want to ORDER BY fieldname but if the field names are xxx-11, xxx-12, xxx-13, xxx-112 and xxx-113 I want them to appear in that order not 11, 112, 113, 12, 13 which appears by default.

It only gets tricky because there are other fields like yyyy 712 and zzzz 516, I'm not having trouble getting them in order, it's just including them in a SELECT statement that will keep the xxx-xx fields in order has really given me a tough time.

It always happens that if the seventh digit is null it requires special treatment. (I think that will be consistent!). And they are always in the form xxx- .

I've tried imbedded SQL but keep getting SQL command not properly ended errorsyes,  syntax problems. I want to use SQL*plus.

Eventually these will appear in a SQL report format and if I can I would like to be able to query on the xxx, yyyy and zzzz fields and see them in logical 'human' order.

I'm running Oracle V.6 on a VAX VMS, any help would be much appreciated, thanks.

Regards,
Allison Rothmel

-- 
Received on Fri Sep 24 1993 - 02:30:41 CEST

Original text of this message