I\'ve got two postgresql tables:
table name column names ----------- ------------------------ login_log
this can also be tried...
SELECT l.ip, tbl2.ip as ip2, tbl2.hostname FROM login_log l LEFT JOIN (SELECT ip_location.ip, ip_location.hostname FROM ip_location WHERE ip_location.ip is null)tbl2