Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How do I sort on final digit of a number?
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
![]() |
![]() |