Re: CIdr query qestion - Mailing list pgsql-sql

From Jesper K. Pedersen
Subject Re: CIdr query qestion
Date
Msg-id 20070710110012.432b76e1@io.solnet
Whole thread Raw
In response to CIdr query qestion  (Michele Petrazzo - Unipex srl <michele.petrazzo@unipex.it>)
List pgsql-sql
On Tue, 10 Jul 2007 09:36:49 +0200
Michele Petrazzo - Unipex srl <michele.petrazzo@unipex.it> wrote:

> Hi ml!
> 
> A question about cidr query. I'm tring to use the various cidr
> functions to exclude a A sub class, but I don't understand how use it:
> 
> SELECT count(ip_addr), ip_addr from wi_log_network where ip_addr !=
> network('10.10.0.0/16', 16) group by (ip_addr);
> 
> it don't exclude the 10.10 ! Tried also the abbr or set_masklen
> keyword, but the same. How do it?
> 
> P.s. Tried the >>, but it only include the values that I want to
> exclude! (And I don't found how to do the opposite!)
> 


Couldnt you do a :

select count(ip_addr), ip_addr from wi_log_network where not (ip_addr
<< '10.10.0.0/16') group by (ip_addr);


Best regards 
Jesper K. Pedersen


pgsql-sql by date:

Previous
From: Michele Petrazzo - Unipex srl
Date:
Subject: CIdr query qestion
Next
From: Michael Fuhr
Date:
Subject: Re: CIdr query qestion