On Fri, Sep 25, 2009 at 4:59 AM, Tony <td_mi...@yahoo.com> wrote:
>
> Is there a way to sort it properly by IP address (so that .2 comes after .1) 
> in either an SQL query or in an XLS sheet ?
>

I hesitate to be 'that guy' but, you should look at using PostgreSQL.
I don't know enough about MySQL to make any suggestions specific to
it.

template1=> SELECT addr FROM inetsort ORDER BY addr DESC;
     addr
---------------
 212.76.90.226
 12.76.90.226
 12.76.89.226
 12.76.88.226
 12.76.87.226
 12.75.87.226
 11.75.87.226
 10.75.87.226
 9.75.87.226
 9.75.87.225
 9.75.87.224
(11 rows)

template1=> SELECT addr FROM inetsort ORDER BY addr ASC;
     addr
---------------
 9.75.87.224
 9.75.87.225
 9.75.87.226
 10.75.87.226
 11.75.87.226
 12.75.87.226
 12.76.87.226
 12.76.88.226
 12.76.89.226
 12.76.90.226
 212.76.90.226
(11 rows)

template1=> \d inetsort
  Table "public.inetsort"
 Column | Type | Modifiers
--------+------+-----------
 addr   | inet |


(:

aaron.glenn

_______________________________________________
pmacct-discussion mailing list
http://www.pmacct.net/#mailinglists

Reply via email to