Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compare an IP address with a subnet in mysql?

Status
Not open for further replies.

fedorafan

ISP
Jul 1, 2006
5
US
Hello,

I am now trying to compare if IP addresses in table1 belong to the corresponding subnets in table 2. e.g.

Table 1

name1 192.168.2.123
name2 192.168.0.1
name3 192.168.10.123

.....


Table 2

dept1 192.168.0.0/21
dept2 192.168.7.0/21
....

so I should get the result that

dept1 has name1 name2
dept 2 has name3
.....

So is there any way I can do it using mysql?
 
It should certainly be possible. If you show us which aspects are causing problems, somebody might be able to help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top