Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Need Help to Sort a String Like a Number
Jamuna wrote:
> Hi All:
>
> I have a column named Release which can contain alphanumeric characters
> and i need to sort this column.
>
> A sample random data set for Release values:
>
> Release
> -------------
>
> 6.1(1)
> 6.1(1a)
> 12.3(1a)C
> 12.3(1c)BW
> 7.6(4)AA
> 7.6(4)X
> 12.2(4)MB13
> 6.1(1c)
> 7.6(3a)
> 12.3(1a)BW
> 12.2(4)MB12
> 12.3(4)TPC11a
> 12.2(4)MB13a
> 12.3(4)Z
>
> After sorting, i need the following order
>
> Sorted Release
> -----------------------
>
> 6.1(1)
> 6.1(1a)
> 6.1(1c)
> 7.6(3a)
> 7.6(4)AA
> 7.6(4)X
> 12.3(1a)BW
> 12.3(1c)BW
> 12.3(1a)C
> 12.2(4)MB12
> 12.2(4)MB13
> 12.2(4)MB13a
> 12.3(4)TPC11a
> 12.3(4)Z
>
>
> Can anyone please help me with this ??
>
> Thanks,
> Jamuna
Go to Morgan's Library at www.psoug.org
Click on "ORDER BY Clause"
Scroll down to: "Non-Default Ordering"
You will need a variation on the same theme.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Wed Jun 21 2006 - 11:02:18 CDT