you might also try this:

select substring(someField, 1, 6),
       count(substring(somefield,1,6
from theTable
group by substring(someField, 1,6)

i tried it in corereader and it seemed to do what 
you want.


> Hello,
> 
> I have a table with only ips in it. I want to get all networks the ips
> belong to:
> 
> Example:
> 
> 123.123.123.1
> 123.123.132.2
> 123.123.123.3
> 1.1.1.4
> 1.1.1.5
> 1.1.1.6
> 12.12.12.1
> 12.12.12.2
> 12.12.12.10
> 
> The result should be:
> 
> 123.123.123.0
> 1.1.1.0
> 12.12.12.0
> 
> Instead of converting on matching row (for example 123.123.123.2) to
> 123.123.123.0 it can be left as 123.123.123.2 or even can be truncated to
> 123.123.123
> 
> The table is stored on a 3.23.43 mySQL Server. The table type is varchar(15)
> but this can be changed.
> 
> Thanks,
> 
> Alexander Newald
> 
> 



-- 
        John Ragan
        [EMAIL PROTECTED]
        http://www.CoreReader.com/ 


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to