Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

IP Adresses - padding zeroes for ORDER BY

415794Apr 7 2004 — edited Apr 13 2004
Hi!

I have a table with an IP address inside (type varchar2(50)). The data inside looks like 192.168.0.1. Now, my app should be able to ORDER BY this ip address. This means, when I do ORDER BY on this column without any changes, the output is wrong:

192.168.0.1
192.168.0.10
192.168.0.11
...
192.168.0.2

and so on.

Is there a way to temporarily pad the leading zeroes, e.g.
to 192.168.000.001?

Thanks in advance

André

PS: To all those who helped me with my large-table-speed-problem some months ago: The project has been dropped :-( Thanks again anyway.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 11 2004
Added on Apr 7 2004
4 comments
593 views