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?
Either way, you won't use an index, so I don't think efficiency is an issue,
unless your CPU is an 8088, and has trouble doing the function.
Wayne Menzie <waynem_at_bosmedtechdotcom.nospam> wrote in message
news:8EC0BA939wayneshammalammading_at_129.250.35.141...
> [posted and mailed]
>
> postmaster_at_sybrandb.nospam.demon.nl (Sybrand Bakker) wrote in
> <948320214.17011.0.pluto.d4ee154e_at_news.demon.nl>:
>
> >order by substr(to_char(test_id), length(to_char(test_id)))
>
> Thank you Sybrand. That does the sort on the last number perfectly.
>
> I had a suggestion to use the following:
>
> ORDER BY MOD(Test_id, 10)
>
> Would this be a more efficient means of doing this? Both seem to work
> properly.
>
> Wayne Menzie
Received on Wed Jan 19 2000 - 20:11:34 CST