Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id CF24B9FB60F for ; Tue, 10 Jul 2007 06:00:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 89660-05 for ; Tue, 10 Jul 2007 06:00:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 6ACCE9FB59E for ; Tue, 10 Jul 2007 06:00:34 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from pasmtpB.tele.dk (pasmtpb.tele.dk [80.160.77.98]) by svr4.postgresql.org (Postfix) with ESMTP id 88E365AF8C0 for ; Tue, 10 Jul 2007 09:00:33 +0000 (GMT) Received: from io.solnet (0x50c60afe.vgnxx3.adsl-dhcp.tele.dk [80.198.10.254]) by pasmtpB.tele.dk (Postfix) with ESMTP id B1AABE3078D; Tue, 10 Jul 2007 11:00:31 +0200 (CEST) Date: Tue, 10 Jul 2007 11:00:12 +0200 From: "Jesper K. Pedersen" To: pgsql-sql@postgresql.org Subject: Re: CIdr query qestion Message-ID: <20070710110012.432b76e1@io.solnet> In-Reply-To: <46933711.4030501@unipex.it> References: <46933711.4030501@unipex.it> X-Mailer: Claws Mail 2.8.1 (GTK+ 2.10.8; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.136 tagged_above=0 required=5 tests=BAYES_50=0.001, FORGED_RCVD_HELO=0.135 X-Spam-Level: X-Archive-Number: 200707/44 X-Sequence-Number: 28779 On Tue, 10 Jul 2007 09:36:49 +0200 Michele Petrazzo - Unipex srl 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