Re: ip contained within subnet

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Scott Brunza <scottso(at)sonalysts(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: ip contained within subnet
Date: 2010-08-19 19:05:16
Message-ID: 25830.1282244716@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Scott Brunza <scottso(at)sonalysts(dot)com> writes:
> select a.ip, b.foo from tablea a, tableb, b where a.id=b.id and a.ip ! <<= (select network from assets where network is not null)

This is definitely not legal SQL. I think you are looking for something
like

select a.ip, b.foo from tablea a, tableb b where a.id=b.id and
not (a.ip <<= any (select network from assets where network is not null))

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Brunza 2010-08-19 19:10:16 Re: ip contained within subnet
Previous Message Scott Brunza 2010-08-19 18:25:00 ip contained within subnet