[nflug] really dumb SQL question

Jason Lasker lasker at eng.buffalo.edu
Fri Dec 16 13:28:47 EST 2005


It is sorting correctly... For alpha sorting 1 come before 2.  (.112 vs.
.20)  You may have to pad left with zeros. (.020 vs. .112)  But this may
cause other issues with your data, depending on what you do with it.  I am
sure someone else will have a more elegant method to solve this sorting
issue. 


Jason Lasker
Senior Systems Administrator
Science and Engineering Node Services
University at Buffalo
113 Bell Hall
Buffalo, NY 14260-2050
Voice: (716) 645-3797 x2172
Fax    (716) 645-3704
email mailto:lasker at eng.buffalo.edu
-----Original Message-----
From: nflug-bounces at nflug.org [mailto:nflug-bounces at nflug.org] On Behalf Of
Eric Benoit
Sent: Friday, December 16, 2005 12:42 PM
To: nflug at nflug.org
Subject: [nflug] really dumb SQL question

I know this is slightly off the topic of this list,

but I know there are some programmers out there ;)

I have a column labled ip address, it is varchar, oddly enough I input ...ip
addresses in it. ha ha ha

Here's my question:

When I query the column and do an "order by ip_address ASC" the records
won't ascend the way I want ex: 192.0.0.20, 192.0.0.112  and so on

instead they ascend this way: 192.0.0.112, 192.0.0.20

I am guessing this is because ASC doesn't like the periods?

A finger pointed in some general direction would be great.

Thanks,
Eric
_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug


_______________________________________________
nflug mailing list
nflug at nflug.org
http://www.nflug.org/mailman/listinfo/nflug



More information about the nflug mailing list