SQL Language (MOSC)

MOSC Banner

How to order "table of contents" type numbed data

edited Feb 25, 2012 9:01AM in SQL Language (MOSC) 2 commentsAnswered ✓
I have a column in a table called toc_number of type varchar2(20).  The data in this column is the number part of a table of contents.  I need to know if there is a way to write a query which sorts this data correctly.

 

Example Data sorted correctly:

9.9

9.9.1

9.9.2

...

9.9.9

9.9.10

9.9.11

 

If you just use the "asc" or "desc" it doesn't sort correctly.  It comes out like:

 

9.9

9.9.1

9.9.10

9.9.11

...

9.9.2

9.9.21

 

Thanks,

Amy

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center