Re: Need help with Inet type - Mailing list pgsql-general

From Christoph Moench-Tegeder
Subject Re: Need help with Inet type
Date
Msg-id 20130911045836.GA62631@reindeer.exwg.net
Whole thread Raw
In response to Need help with Inet type  (Eric Lamer <eric.lamer@intact.net>)
List pgsql-general
## Eric Lamer (eric.lamer@intact.net):

>   I can do something like:
>
>    Select * From logs Where src_ip IN (Select ip from ip_table where zone
> = 'ZONE_a');
>
>    Of course that does not work since it does not work with Inet type and
> I cannot use << because I have more than 1 row return from the second
> select.

How about:
   SELECT DISTINCT logs.* FROM logs
     JOIN ip_table ON logs.srcip << ip_table.ip
     WHERE zone = 'ZONE_a';

Regards,
Christoph

--
Spare Space


pgsql-general by date:

Previous
From: James Sewell
Date:
Subject: pg_largeobjects
Next
From: John R Pierce
Date:
Subject: Re: pg_largeobjects