Select rows which are not present in other table

后端 未结 4 2090
抹茶落季
抹茶落季 2020-11-21 07:47

I\'ve got two postgresql tables:

table name     column names
-----------    ------------------------
login_log             


        
4条回答
  •  逝去的感伤
    2020-11-21 07:50

    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
    

提交回复
热议问题