List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:March 29 2001 5:39pm
Subject:Re: new type of data: IP or NETADDRES: help me.
View as plain text  
mario.lat@stripped wrote:
> 
> I have to put in my table a new type of data:
> IP and NETADDRES
> how can I do?
> what is (for you) the best way to do it?
> 
> I think I'll make 4 INTEGER ( an IP is made by 4 number eg. 121.33.122.133)
> 
> But then I have to get the little Net to which belong an IP
> I mean:
> if in my database there is:
> 121.33.122.100
> 121.33.00.00
> 121.33.00.00
> 
> and I have to know which Net belong the IP 121.33.122.143
> the right choise is 121.33.122.100
> so I have to order this column in right way!?!?
> 
> but how can I do than?!?!
> Thank you in advance for your help.
> 
> I think to do that by ordering the column then get the first row taken by the
> follow query:
> 
> select * from name_table where IP1>INT1, IP2>INT2, IP3>INT3, IP4>INT4;
> 
> where IPx is the fisrt, second,... part of an IP
> and INT1, INT2... is the four columns in my db.
> 
> I hope I'm clear and I'm very sorry for my little english.
> I thak very much all people had read this mail!
> 
> Mario.
> 
> mario.lat@stripped
> 

Check the misc functions of the  manual for INET_NTOA and INET_ATON.
Thread
new type of data: IP or NETADDRES: help me.mario.lat29 Mar
  • Re: new type of data: IP or NETADDRES: help me.Gerald Clark29 Mar