Search Postgresql Archives

Re: Need help with Inet type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



## Eric Lamer (eric.lamer@xxxxxxxxxx):

>   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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux