List:General Discussion« Previous MessageNext Message »
From:Vivek Khera Date:November 30 2000 6:28pm
Subject:Re: How to compare IP addresses using SQL
View as plain text  
>>>>> "TC" == Todd Caine <tcaine@stripped> writes:

TC> I also store the IP address in it's binary form so that 10.0.0.0 would
TC> look like:
TC> 00001010 00000000 00000000 00000000
TC> with a subnet mask of
TC> 11111111 11111111 11111111 00000000

Why not just store them as 32-bit INTEGERS, which is all that they are
anyhow.  Then your logical ops and comparisons will just work as
expected.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@stripped       Rockville, MD       +1-240-453-8497
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/
Thread
How to compare IP addresses using SQLTodd Caine30 Nov
  • Re: How to compare IP addresses using SQLVivek Khera30 Nov
  • Re: How to compare IP addresses using SQLTodd Caine30 Nov