Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How do I sort on final digit of a number?

Re: How do I sort on final digit of a number?

From: Sybrand Bakker <postmaster_at_sybrandb.demon.nl>
Date: Wed, 19 Jan 2000 23:15:06 +0100
Message-ID: <948320214.17011.0.pluto.d4ee154e@news.demon.nl>


order by substr(to_char(test_id), length(to_char(test_id))) should do the trick.

Hth,

--
Sybrand Bakker, Oracle DBA
Wayne Menzie <waynem_at_bosmedtechdotcom.nospam> wrote in message news:8EC0A302Cwayneshammalammading_at_129.250.35.141...
> I have a field that I need to sort on the final digit of a number like
> this:
>
> Unsorted Sorted
> Test_id Test_id
> ------- -------
> 101 101
> 402 201
> 1401 401
> 201 1401
> 202 202
> 401 402
>
> Is there any way to do this with SQL or PL/SQL?
>
> Wayne Menzie
Received on Wed Jan 19 2000 - 16:15:06 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US