0
基本上我要完成的,是我想要的test.zfirewallaudit.src_ip
和test.zfirewallaudit.dst_ip
領域加入對inventory.dns_zones.ip
列,所以我基本上可以有一個準確的主機名(inventory.dns_zones.subdomain
)爲test.zfirewallaudit.src_ip
和test.zfirewallaudit.dst_ip
。所以基本上我想要一個src_ip子域的列和一個dst_ip子域的列。Mysql的留在同一列加入多個列
SELECT test.zfirewallaudit.src_ip,
test.zfirewallaudit.src_zone,
test.zfirewallaudit.dst_ip,
test.zfirewallaudit.dst_zone,
test.zfirewallaudit.dst_port,
test.zfirewallaudit.rulename,
test.zfirewallaudit.application,
inventory.dns_zones.subdomain
FROM test.zfirewallaudit LEFT JOIN inventory.dns_zones ON zfirewallaudit.src_ip = inventory.dns_zones.ip OR zfirewallaudit.dst_ip = inventory.dns_zones.ip LIMIT 10;
問題是,我需要的inventory.dns_zones.subdomain
同時爲test.zfirewallaudit.src_ip
和...dst_ip
值。當前的查詢只給我1 subdomain
列