Hi, Ron.

I think REGEXP can help you..

http://dev.mysql.com/doc/refman/5.0/en/regexp.html


Im trying to select an IP from a TEXT (details) type field, which works if I do this:
select id from `table` where `details` like '%192.168.0.1%' :

But If I want any record with an IP in that TEXT type field it seems a little 
tricky.
I have tried:
select id from `table` where INET_ATON(details) BETWEEN INET_ATON('127.0.0.1') 
and
INET_ATON('192.168.0.2');
select id from `table` where INET_ATON(details) BETWEEN INET_ATON('%127.0.0.1%')
and INET_ATON('%192.168.0.2%');
select id from `table` where details BETWEEN INET_ATON('%127.0.0.1%') and 
INET_ATON('%192.168.0.2%');

For instance I know this IP (192.168.0.1) is in 14 different records, what I 
was hoping for is
a result like so doing a wildcard search for any IP in this text field.
+----------+
| id |
+----------+
|       66 |
|      148 |
 etc......
14 rows in set (0.01 sec)

Any other ideas on how I could do this? Ron



--
Regards,
Eugene Kosov

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to