Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Sorting alphanumeric column
My initial post was not a typo. Sorry if I was not clear enough.
Basically, I need to sort the numbers first and then any preceding
chars if they should exist. I need to do more testing, but I think the
following suggestion works perfectly. BTW, I am using Oracle9i
Enterprise Edition Rel 9.2.0.3.0 on AIX platform. Sorry, I am not sure
what "top post" means. I will not do in the future if you explain what
it means.
I am new to Oracle (prev Sybase/SQL Server) and don't quite know all of its capabilities. Thanks for all your time and suggestions!!!
select *
from
(
select col , translate(col,'x1234567890.', 'x') b_nonnum, to_number( translate( col,'1' || translate(col,'x1234567890.', 'x'),'1')) as b_num from tam
TA2.0 TA 2 UA2.0 UA 2 2.1 2.1 2.3 2.3 3 3 UA4.0 UA 4 UB4.0 UB 4 4 4 4.5 4.5 TB4.8 TB 4.8 TA4.9 TA 4.9 5 5 6 6 UA7.1 UA 7.1 7.1 7.1 TA8.0 TA 8 UA8.0 UA 8 UB8.0 UB 8 8 8 UA9.0 UA 9 9 9 UA10.0 UA 10 10 10 10.5 10.5 13 13 TA2.0 TA 2 UA2.0 UA 2 2.1 2.1 2.3 2.3 3 3 4 4 UB4.0 UB 4 UA4.0 UA 4 4.5 4.5 TB4.8 TB 4.8 TA4.9 TA 4.9 5 5 6 6 7.1 7.1 UA7.1 UA 7.1 8 8 UB8.0 UB 8 UA8.0 UA 8 TA8.0 TA 8 9 9 UA9.0 UA 9 10 10 UA10.0 UA 10 10.5 10.5 13 13Received on Thu Jun 02 2005 - 14:40:04 CDT
![]() |
![]() |